in reply to Threads, Forks, or Nothing?
There are three ways you can achieve multiprocessing:
You don't need kernel threads to write multithreaded applications. You just need to break your problem up in to chunks, build a little "run-queue" of waiting chunks of code, make sure all your system calls are non-blocking, and have a loop that picks the first chunk off the queue and runs it. In many cases, this type of threading may actually outperform kernel enforced lightweight processes. Sure, you might still hang somewhere if you've a bug, but that's always the case, isn't it?
|
|---|