473,511 Members | 15,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catching events in a worker thread?

Hi all,

I have a windows form that uses an imported COM class to talk to a legacy
system. The COM object works asynchronously - An event is fired when data
has
been returned.

This works fine, except that Im getting too many events fired! Thus my
windows form becomes pretty sluggish and unresponsive, and CPU utilistaion
is pretty high.

Is there any way I can set up another thread to recieve and handle these
events instead? Do threads have event loops? If so, how do I "direct" events
to them?

I have considered starting off a thread each time the event is fired - but
the event handler is pretty trivial so im not sure if this will help (since
starting a thread is more intensive than handling the event). Maybe I should
start a worker thread once at the start and set this to listen for messages
from the main event handler? How would I do that?

Is this even possible? Or am I tackling this in the wrong way?

Thanks!

Spammy


Jul 21 '05 #1
0 1434

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4925
by: Drakier Dominaeus | last post by:
This is my first time posting here, so please forgive me if I do anything incorrectly. I've been learning C# and working with different things and decided I wanted to get into Multi-Threading....
3
506
by: Jacob | last post by:
I'm working on a class that needs to be called from a windows form, do it's work, and then, show progress back to the main form. I'm well aware that worker threads need to call Invoke for updates...
2
1433
by: Wavemaker | last post by:
I have a class written in C# which uses a worker thread internally to do some processing. It's possible that an exceptional situation can arise in the worker thread, and as the class is presently...
5
2410
by: Ron James | last post by:
In my multi-threaded application, a Win32 structured exception is occasionally thrown from a worker thread. Or perhaps a worker thread might throw a C++ exception. I can catch the Win32...
5
2592
by: Bill Davidson | last post by:
Hello All: I've got a question about synchronization requiremements in a C# worker thread procedure that, among other things, sinks events from outside sources. I realize the worker thread will...
1
1768
by: Bill Davidson | last post by:
(RESEND: I added a little more code to the sample for clarity) Hello All: I've got a question about synchronization requiremements in a C# worker thread procedure that, among other things,...
1
1221
by: Tom | last post by:
First of all, is it 'legal' (i.e. thread-safe) to pass events back from a worker thread to the main thread? I.E. Can one put PUBLIC EVENT XYZ in their worker thread and then raise that event for...
0
331
by: spammy | last post by:
Hi all, I have a windows form that uses an imported COM class to talk to a legacy system. The COM object works asynchronously - An event is fired when data has been returned. This works...
5
2383
by: Dan Tallent | last post by:
I am trying to learn how to create an application that uses worker threads to prevent the UI from freezing up. My question is: Is the following code considered "thread safe"? If not, what am I...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.