From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: erik quanstrom Subject: Re: [9fans] Thread Library Message-Id: <20020206171914.AFECF3F40B@quanstro.net> Date: Wed, 6 Feb 2002 12:19:14 -0500 Topicbox-Message-UUID: 4d5dce2c-eaca-11e9-9e20-41e7f4b1d025 not to defend nt, but i had no problem calling select() from the wsa library. i did create an include file that mapped the errors from WSAx to Ey and hid all the include nasties (unix is even worse than nt in this case). it looked like: ------ #if defined(NT) #define boolean _fuck_windows_ #include #undef boolean #ifndef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define EALREADY WSAEALREADY #define ENOTSOCK WSAENOTSOCK #define EDESTADDRREQ WSAEDESTADDRREQ #define EMSGSIZE WSAEMSGSIZE #define EPROTOTYPE WSAEPROTOTYPE #define ENOPROTOOPT WSAENOPROTOOPT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT #define EOPNOTSUPP WSAEOPNOTSUPP #define EPFNOSUPPORT WSAEPFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT #define EADDRINUSE WSAEADDRINUSE #define EADDRNOTAVAIL WSAEADDRNOTAVAIL #define ENETDOWN WSAENETDOWN #define ENETUNREACH WSAENETUNREACH #define ENETRESET WSAENETRESET #define ECONNABORTED WSAECONNABORTED #define ECONNRESET WSAECONNRESET #define ENOBUFS WSAENOBUFS #define EISCONN WSAEISCONN #define ENOTCONN WSAENOTCONN #define ESHUTDOWN WSAESHUTDOWN #define ETOOMANYREFS WSAETOOMANYREFS #define ETIMEDOUT WSAETIMEDOUT #define ECONNREFUSED WSAECONNREFUSED #define ELOOP WSAELOOP #define EHOSTDOWN WSAEHOSTDOWN #define EHOSTUNREACH WSAEHOSTUNREACH #define EPROCLIM WSAEPROCLIM #define EUSERS WSAEUSERS #define EDQUOT WSAEDQUOT #define ESTALE WSAESTALE #define EREMOTE WSAEREMOTE #endif #else #include #include #include #include #include #endif ---------- Russ Cox wrote: > To the best of my knowledge, you can't implement threadkill > completely on NT since I don't see how to send an interrupt to > another process. I'm pretty sure you can't. The best you can do is send it a message to _persuade_ it to pack it in. My theory is that the program loader, oops kernel, forcibly kills processes by ripping them out of memory and throwing away their kernel resources. The whole model is totally and utterly flawed. I guess you could have a thread manager thread that receives a threadkill messages and kills 'em. Such revolting hacks are often the only way to do it. Try writing rsh [remote shell] on NT. You can't select [WaitForMultipleObjects or whatever it's called] on sockets ... It's doable, but revolting.