Communication between threads
Posted on 2004-11-08
I have just started a project that has me utilizing threads for the first time. For the most part, everything seems to be working however I am at a crossroads and could use some advice.
I'll try to describe what is happening as best I can. The app is a user interface that shows representation from hardware in the field (so far PLC values). I order to obtain these values I must continously poll the devices as there are no message events. The UI must always be accessible (no noticable delays) and has to 'read' and 'write' values out to the field devices.
So far I have a class that extends Thread and it seems to be working well. I have started on the UI portion and it doesn't look like that will be a problem either.
I figure that the UI could dump requested device writes into a Hashtable and the device object could read the hashtable for requests before the next poll.
The problem that I have is in getting data changes from the device object to the UI. I could really use a nudge in the right direction as I don't want to slow the polling down for UI updates.
Please only answer if you have threading experience and thank you in advance.