home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / win32 / 1824 < prev    next >
Encoding:
Text File  |  1992-11-06  |  2.3 KB  |  55 lines

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