| Until the forthcoming HP-UX 10.30, HP does not have "real" threads -- only
the OSF "DCE threads", which operate entirely in user-mode, with no support
(or knowledge) in the kernel. The user-mode thread library (which, by the
way, Digital originally wrote) uses select() and non-blocking I/O mode to
make "most" I/O operations appear to block only the calling thread. However,
that's only partly effective. UNIX typically "lies" about file system I/O,
for example, assuming that the file system cache makes all operations
"instantaneous" -- select() will never admit that the I/O will block. And, of
course, the method won't work for anything that's not supported by select(),
such as semaphores and message queues. Therefore, all such operations
unavoidably block the process.
Digital UNIX has true thread support. In fact, it's nearly impossible to
"block the process" in Digital UNIX, because there's really no such thing as
a process. (It's a set of data structures fabricated in the Mach kernel to
let the rest of the kernel pretend it's UNIX.) Digital UNIX does not schedule
"processes" -- it schedules threads. So, to block a process, some O/S code
would need to find the current Mach task, traverse a queue of threads
associated with that task, and block each of them individually. Of course it
can be done -- but it can't happen by accident or oversight! No standard
kernel blocking call (i.e., I/O operation) does this, so even those that
"don't know about threads" will still only block the calling thread.
/dave
|