Linked by Thom Holwerda on Sat 7th Feb 2009 00:35 UTC, submitted by PlatformAgnostic
Windows M:N threading, in which a single kernel thread is multiplexed to run multiple logical user mode threads, has long been a feature of some Unix systems (Solaris and FreeBSD have had it for years). Even Windows NT has had "Fibers" for several releases, though they suffered from the same problems as other M:N schemes and were incompatible with many Win32 APIs. Join Windows Kernel Architect Dave Probert for a discussion on the new User Mode Scheduling Feature which solves these problems while allowing applications fine grained control over their threads.
Thread beginning with comment 347565
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: hmmm
by galvanash on Sat 7th Feb 2009 02:54 UTC in reply to "hmmm"
galvanash
Member since:
2006-01-25

I am far from an expert at windows programming, but I thought the way it worked were processes were big, heavyweight things that contained multiple threads, as opposed to Unix which just had threads and would fork them.


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.

Reply Parent Bookmark Score: 4

RE[2]: hmmm
by google_ninja on Sat 7th Feb 2009 04:02 in reply to "RE: hmmm"
google_ninja Member since:
2006-02-05

That makes sense, but I figured that part of the overhead of windows processes had to do with scheduling. guess I was wrong

Thanks for the info ;)

Reply Parent Bookmark Score: 2

RE[2]: hmmm
by PlatformAgnostic on Sat 7th Feb 2009 06:45 in reply to "RE: hmmm"
PlatformAgnostic Member since:
2006-01-02

Actually you got M and N reversed ;) .

The kernel cares about N and the M is handle in user-mode.

Reply Parent Bookmark Score: 2