Thread View: comp.os.os2.programmer
1 messages
1 total messages
Started by Andreas Kaiser
Sun, 17 Mar 1991 09:09
Help With Unblocking Threads
Author: Andreas Kaiser
Date: Sun, 17 Mar 1991 09:09
Date: Sun, 17 Mar 1991 09:09
24 lines
1934 bytes
1934 bytes
In einer Message an All, vom <16 Mar 142 03:02>, schreibst Du:
CG> I have a multi-thread application. There are 4 threads, although
CG> only 2 are of interest here. The main thread controls network
CG> operations, and thread 2 controls the keyboard. If the user wants
CG> to terminate the connection, they hit Esc. When the keyboard thread
CG> detects the Esc key stroke, it calls DosFlagProcess and ends. This
CG> in turn unblocks the network read (EINTR) and thread 1 cleans up
CG> and does some other processing. This all works great.
CG> A problem arises however when the server application wants to end
CG> the transaction. The network read ends when the connection is closed,
CG> but how do I end the keyboard thread???
By DosExit :-). The "famous" multi-threading of OS/2 is seriously incomplete, since the only way to control threads is Suspend. That's it. No signalling, no way to kill a thread.
If you need threads which have to communicate by signals or have to kill each other, use parallel processes with shared memory.
There is another way: The MSDOS approach ;-). Forget all you learnt about efficient multitasking and do a timer-poll on every resource which does not have a timeout possibility. Not the way OS/2 was built for, but sometimes is the only way to do real-time processing, especially since device monitor calls do not have timeouts.
Gruss, Andreas
* Origin: kaiser@ananke.stgt.sub.org - Stuttgart (2:244/7014.0)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads