473,434 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Custom Event handling + thread handling.

I've written an event that tells me that I've connected properly to a
remote telnet location. When I know that I'm connected I fire the event
which is being listened for in a bit of code that then goes on and does
some work based on this event.

My problem is that once I fire that event, the thread that fired it
waits until the thread that received it finishes. I fixed the problem
by making the bit of code that is listening for the event continue on
with what it is doing in the background, but I'm wondering if there is a
different way.

Specifically, the code is going through a csv file and then doing a few
things on a remote system to get information based on something in the
csv, and then processing that information once we get it.

Everything works fine, but I'd like to know what I'm doing wrong, in
that I don't think that the thread should be tied up waiting for
whatever was listening for the event to finish.

Any help, or pointing in the right direction is as usual, very much
appreciated.

regards,
M.
Nov 17 '05 #1
1 1559
Hmmm. I was working on events on my screensaver, and I utilize events and I
noticed that the program output mentions that a separate thread that handles
events. I think it called it the NetEvent thread, which confirmed my
suspicion that events are handled on a separate thread.

My suggestion is to create a worker thread to start the event running, and
then when it is done, have the thread end.

"Michael McCarthy" <no********@nomail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I've written an event that tells me that I've connected properly to a
remote telnet location. When I know that I'm connected I fire the event
which is being listened for in a bit of code that then goes on and does
some work based on this event.

My problem is that once I fire that event, the thread that fired it waits
until the thread that received it finishes. I fixed the problem by making
the bit of code that is listening for the event continue on with what it
is doing in the background, but I'm wondering if there is a different way.

Specifically, the code is going through a csv file and then doing a few
things on a remote system to get information based on something in the
csv, and then processing that information once we get it.

Everything works fine, but I'd like to know what I'm doing wrong, in that
I don't think that the thread should be tied up waiting for whatever was
listening for the event to finish.

Any help, or pointing in the right direction is as usual, very much
appreciated.

regards,
M.

Nov 17 '05 #2

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

Similar topics

8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
4
by: NutJob | last post by:
Hello, I'm faced with the following problem: I have a (secondary) thread that monitors a socket for incoming message traffic using the select.select() function. Besides that I also have the...
1
by: Beren | last post by:
Hello With trial and error I'm attempting to create an extended identity to store some more data than just the Name, for example a Subscription and a LastSearchPerformed property... Is this a...
2
by: Paul E. Orman | last post by:
I have a piece of VB code (.NET 1.1 - VB 2003) that loads data from a database through a timer. So the timer is setup and from it I call the procedure that loads the latest records from the...
10
by: Jon | last post by:
I'm investiging multi-threaded GUI applications; specifically the technique used to ensure that controls are only modified under the correct thread. The standard technique is to use ...
1
by: David Herbst | last post by:
Enterprise Library Jan 2006 with Visual Studio 2005 on Windows 2000 Server sp4. My custom exception formatter fails with a "Unable to handle exception: 'LoggingExceptionHandler'." exception. ...
4
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
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
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.