Google's behavior makes sense
Posted Jul 13, 2009 2:05 UTC (Mon) by quotemstr
In reply to: Google's behavior makes sense
Parent article: Google Chrome OS and the community
If you take the core Win32 API for comparison - only the IO operations and thread management - it is really clean and orthogonal, quite unlike POSIX
Clean and orthagonal? Like the WaitForMultipleObjects arbitrary 64-object limitation? Like the inability to wait on sockets using the thing without a WSAEventSelect? But wait -- if two threads are waiting on a single socket using WSAEventSelect, the second thread's event notification silently overwrites the first: i.e., only one thread can really wait on a given socket at a time.) How about the mess that's the named pipe interface, and its bastard stepchild, the anoymous pipe interface? How about having to care about the distinction between MsgWaitForMultipleObjects and WaitForMultipleObjects? And how on earth is it clean for COM initialization to implicitly create a GUI window for the thread?
Or how about the fact that sockets are in an undefined state after timing out? How about the horror that is CreateProcess, compared to fork? How about condition variables only being introduced in Windows Vista? How about the half of the functions that return NULL for failure and the half that return INVALID_HANDLE_VALUE?
What about handle inheritance? This deserves its own paragraph. Win32 can pass a HANDLE (for some objects) from a parent process to a child object, but unless you make that HANDLE one of the standard descriptors of a process (i..e, stdin, stdout, or stderr), you need to pass the *numeric value* of the handle to the child through some other mechanism (say, a command-line parameter), have the child pick that value up, and start using it. It's a kludge. Even SCM_RIGHTS is clean compared to that.
Granted, the Win32 event stuff is better than the rest of Win32. But while the worst part of POSIX is the setuid/seteuid mess, the setuid kind of arbitrary ugliness is par for the entire win32 API.
to post comments)