Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 2 > [TS3.10] Multit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 300 of 376
Post > Topic >>

[TS3.10] Multithreading problem

by "Peter Engels" <p.engels@[EMAIL PROTECTED] > Sep 27, 2006 at 07:28 PM

Hi all,

I have the following problem and cannot find a good solution, perhaps
anyone of you has an idea:

My TopSpeed 3.10 program needs three independent threads, two of them
need input form the keyboard/mouse, the third thread does not.
Therefore I have implemented a fourth thread, which is looking for
keyboard/mouse events and stores the events in a queue. If an event is
available the process sends a signal sEventAvailable. The two threads
needing input are calling the procedure

PROCEDURE GetEvent (VAR Event : EVENT);

BEGIN
  WAIT (sEventAvailable);
  Event := PopEvent ();
END GetEvent;

This works very well, if only one process is waiting for input, but it
will obviously not work, with two or more processes, because it is not
clear, whether the event belongs to the calling process or not. Any
ideas to solve this problem in an easy way?

MfG / Regards

	Peter Engels

-- 
This OS/2 system uptime is 00 hours, 56 minutes and 33 seconds.
Please use the reply-to address for e-mails!
 




 2 Posts in Topic:
[TS3.10] Multithreading problem
"Peter Engels"   2006-09-27 19:28:45 
Solved: [TS3.10] Multithreading problem
"Peter Engels"   2006-09-29 22:18:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:18:53 CDT 2008.