[Mono-devel-list] Mono on a multipocessor

Thomas Harning Jr. harningt at gmail.com
Thu Apr 21 15:51:55 EDT 2005


Alex Chudnovsky wrote:
> From what I understood blocking IO (at least for sockets) is done by
> actually using async IO and making artificial wait for its to finish and
> then return result, and therefore usage of number of threads should be
> as much or higher (more likely higher) than in async IO model that I use
> now.
That isn't how its really done, particularly in linux.  Now for Windows, it's kind of interesting, their whole IO Model is Async with blocking as a case where the request is sent to the OS for async io and then the blocking call waits for it to finish.  This spawns no threads to deal with Async IO.
For actual async IO on windows, you send the async request and a wait-handle to use for checking if its done.  You can also have it do a callback on completion, which would be called in one of the OS's thread-pool threads [I'm not sure if MS .Net pushes the callback into its threadpool freeing the OS threadpool-thread or not].
The way Windows handles working with the Async call while you're waiting or whatnot, is through interrupts from the network handler I believe... so there's no thread exactly watching for IO completion and whatnot... just a function that handles the interrupt and marshalls the work off.
[From my Operating Systems class... might have mixed a thing or two, but its mostly right]

-- 
Thomas Harning Jr.


-- 
Thomas Harning Jr.



More information about the Mono-devel-list mailing list