home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.win32
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!concert!sas!mozart.unx.sas.com!sasdxk
- From: sasdxk@skyhawk.unx.sas.com (Dave Kolb)
- Subject: Thread signalling and ERROR_INTERRUPT (shades of OS2 1.3)
- Originator: sasdxk@skyhawk.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <Bx9rz8.I9t@unx.sas.com>
- Date: Fri, 6 Nov 1992 00:57:07 GMT
- Nntp-Posting-Host: skyhawk.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 42
-
-
- Is there any concept of the OS/2 ERROR_INTERRUPT return code for
- Windows NT WIN32 calls made into a blocking system call by a thread?
-
- I.E. After GUI ^C msg, can the GUI thread signal a worker thread
- blocked in a system call and have the system call return some such
- interrupt return code so that worker thread can perhaps decide upon
- some other action rather than waiting forever.
-
- If not, how can you "wake up" a thread in a multi-threaded application
- that happens to be blocked in a system call such as a Windows SOCKET
- or 3270 HLLAPI call? Blowing away the thread is not an option.
- Nor can a list of semaphores be waited on instead.
-
- IBM screwed this up in OS/2 2.0! You used to be able to do a
- DosFlagProcess(flaga/b) and wake up the primary thread in OS/2 1.3
- anyway. Not general for all threads but you could at least wake up
- from blocked system calls in the main thread if you got tired of
- waiting and then cleanup or do something else.
-
- Does anyone else percieve a need for this sort of mechanism?
-
- It's kind of messy stuff but useful to HLLAPI and TCP/IP to help
- field a ^C interrupt when tired of waiting. The GUI thread would
- set a flag or something and then signal the worker thread who would
- get the ERROR_INTERRUPT, check the flag, run a requester window
- or just cleanup things.
-
- How else can you deal with blocked worker threads?
-
- Microsoft - what's your philosophy here? IBM says under OS/2 2.0
- you should just kill the hung thread from the main process and there
- doesn't seem to be much left to the ERROR_INTERRUPT concept.
-
- Thanks for ideas,
-
- --
- Dave Kolb Opinions are mine not SAS'
- SAS Institute, Inc. EMAIL: sasdxk@unx.sas.com
- SAS Campus Drive - J206 Phone: (919) 677-8000 x6827
- Cary, NC 27513-2414 USA FAX: (919) 677-8123
-
-