473,809 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How many threads are involved when a client receives an event?


I'm trying to understand how many threads are involved when a client event
handler is called.

I am using a simple .net windows application. I click a button on a form
that triggers an event. The event delegate calls two event handlers in two
seperate object instances.

Are the event handlers getting called sequentially relative to the main
thread or are seperate threads being generated to handle the events?

Are there .net application settings that change this?

Your explanation will be appreciated.
Jul 21 '05 #1
1 1435
Form (and its child controls) events are all called sequentially
(synchronously) within the main thread.

In order to have event code run in a separate thread, you must
explicitly code it to do so (using normal threading techniques).

Note, you should never update a form (or any control) from a different
thread.

Joshua Flanagan
http://flimflan.com/blog
Jerry J wrote:
I'm trying to understand how many threads are involved when a client event
handler is called.

I am using a simple .net windows application. I click a button on a form
that triggers an event. The event delegate calls two event handlers in two
seperate object instances.

Are the event handlers getting called sequentially relative to the main
thread or are seperate threads being generated to handle the events?

Are there .net application settings that change this?

Your explanation will be appreciated.

Jul 21 '05 #2

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

Similar topics

8
3131
by: Dennis C. Drumm | last post by:
I have a class derived from a SortedList called SystemList that contains a list of objects indexed with a string value. The definition of the objects contained in the SortedList have a boolean field and an event that is fired if the boolean field value changes. The derived SortedList class has an override for the Add method. The Add method adds an event handler for the object's event for each new item added to the list. In the...
4
3909
by: Anatoly | last post by:
Put any control on web page. create Init event for ths control. Write Response.Write("here") inside this event. Compile\build\run. I never saw "here" string appear on web page. Why???
1
295
by: Jerry J | last post by:
I'm trying to understand how many threads are involved when a client event handler is called. I am using a simple .net windows application. I click a button on a form that triggers an event. The event delegate calls two event handlers in two seperate object instances. Are the event handlers getting called sequentially relative to the main thread or are seperate threads being generated to handle the events?
0
1760
by: tony | last post by:
Hello!! I have a derived class called StringClassEditor which inherit from UITypeEditor listed below. Now to my question in method EditValue in this class I have this statement lb.KeyDown += new KeyEventHandler(ListBox_KeyDown); I have set a breakpoint in the event handler method ListBox_KeyDown but this method is never called. So this event KeyDown for control ListBox is never occuring.
2
1880
by: Chameleon | last post by:
I have a BIG php output and I start to transmit after client's request. What happen on server when client press "Stop"? PHP continues to send data? Where? Until the end?
3
3043
by: Paul | last post by:
Hi all, I've been trying unsuccessfully to stop client side event validation. I've created a simple page with a text box, a required field validator and a server button with the following settings: 1. <pages enableEventValidation="false"in web.config 2. EnableClientScript="false" in the required field validator. 3. EnableEventValidation="false" in the Page directive (which, I know, is not necessary).
8
2265
by: zacware | last post by:
I have an AJAX enabled page which contains a list of records out of a database which are loaded into a div via an AJAX call. If the user switches to another window, and comes back to this open window later on, I want the list of records to be udpated when the window is back in front a simple onFocus doesn't work, as what happens is that if a button is clicked on the window it causes the onfocus to fire as well
6
1830
by: Murray Hopkins | last post by:
Hi. THE QUESTION: How do I get a reference to my Object when processing an event handler bound to an html element ? CONTEXT: Sorry if it is a bit long. I am developing a JS calendar tool. One of the requirements is that the calendar will need to display a varying number of months (1..3)
8
1319
by: AAaron123 | last post by:
If IE is open I'd like my app to receive an event or otherwise know when IE receives a mouse click. Is that fairly easy to do? Thanks in advance
0
9722
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10391
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
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 we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.