Linked by Thom Holwerda on Sat 7th Feb 2009 00:35 UTC, submitted by PlatformAgnostic
Thread beginning with comment 347565
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.







Member since:
2006-01-25
In windows processes are heavy and kernel threads are much lighter. In Linux processes are much, much lighter than in Windows - kernel threads are lighter still but the difference isn't as extreme. Essentially it boils down to Linux process management structures being very heavily performance optimized (mostly because threads were not attractive to most Linux programmers early on so a whole lot of work went into make fork() cheap)
So processes in Linux tend to be cheap enough that using kernel threads is often not worth the complexity it adds and parallel programming is often done just using simple fork() calls. On windows forking processes to achieve parallel execution is MUCH slower than using threads - so much so that is is seldom done outside of special case scenarios.
M:N threading is yet another layer of abstraction where essentially the OS only knows or cares about scheduling the M side - the N side is scheduled using a userland library. The M side can be a process or a thread depending upon how the library is implemented.