HackerTrans
TopNewTrendsCommentsPastAskShowJobs

otabdeveloper1

no profile record

comments

otabdeveloper1
·8 वर्ष पहले·discuss
> This seems like a poorly thought out plan, and unnecessary at that.

Welcome to Google Future (c). Enjoy your stay.
otabdeveloper1
·9 वर्ष पहले·discuss
> Applications that create too many threads that are constantly fighting for CPU time (such as Apache's HTTPd or many Java applications) can waste considerable amounts of CPU cycles just to switch back and forth between different threads.

Completely wrong. Context switches happen at a set interval in the kernel. Creating more threads won't make context switches happen more frequently, each thread will just get a proportionally smaller share of CPU time.

Conceptually, the CPU scheduler can be thought of as a LIFO queue. An interrupt fires at a fixed interval of time and switches to the first ready thread (or process) on the queue.

What's more important is the fact that this queue is exactly equivalent to how 'asynchronous' operations are implemented in the kernel.

The only difference between creating threads and using async primitives is the thread prioritization algorithm. With threads you're using whatever scheduling heuristics are baked into the kernel, while with async you can roll your own. (And pay the penalty of doing this in usermode.)