473,511 Members | 16,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multithreaded events in dll to prevent blocking

Opa

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on the
same thread. I want the dll to fire events back on a different thread, but
am not sure how to go about this.

The dll has many events,, each event has different event arguments, so must
I create a thread for each event?

Without these threads, my winform app sometimes seems to "miss" the events
fired from the dll.

Can anyone guide me with some sample code? Perhaps a url demonstrating this?

Thanks

Nov 22 '05 #1
1 1204
"Opa" <Op*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on
the
same thread. I want the dll to fire events back on a different thread,
but
am not sure how to go about this.


Events are always fired on the same thread as the code raising the event. If
this might be a different thread from the one containing the message loop,
then the event handler must use Form.Invoke. Otherwise, you'll see the kind
of problem you've seen.

John Saunders
Nov 22 '05 #2

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

Similar topics

6
2769
by: Dan Kelley | last post by:
We have a multithreaded app that responds to events, and writes these events to a text file. This text file is used by an external system for further processing. We want to be able to write...
1
270
by: Opa | last post by:
I have a synchronous socket dll which fires several events to a winforms client. The winform calls methods on the dll and the dll fires an event back on the same thread. I want the dll to fire...
1
4677
by: edgar Okioga | last post by:
Hi, Please answere me on my email :) I have a socket server that monitors a linux directory for file changes. These steps take place : 1) Once a new file is added to the directory, the...
6
302
by: Dan Kelley | last post by:
We have a multithreaded app that responds to events, and writes these events to a text file. This text file is used by an external system for further processing. We want to be able to write...
0
7242
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
7138
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
7355
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
7081
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
7510
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...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5066
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
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.