473,395 Members | 1,668 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,395 software developers and data experts.

asynch delegates - when is the WaitHandle signalled ?


I am looking at using delegates to perform an asynchronous call.
There will be a callback invoked at the end of the call.
The client thread will wait on the WaitHandle from IAsyncResult (which is
really a AsyncResult).

My question is, when exactly is this WaitHandle signalled - is it:

-when the asynchronous call finishes
OR
-when EndInvoke() is called (by the callback)

I need to know this, to synchronise the client thread and asynch thread.
This is so the asynch thread knows whether the client thread has timed out.

Is the behaviour the same on all versions of .NET ? (the documentation is
unclear, so it could implemented either way ?)

Thanks,

Sean

Oct 23 '06 #1
1 2622
Sean,

It is signaled when the delegate completes.

Brian

Sean wrote:
I am looking at using delegates to perform an asynchronous call.
There will be a callback invoked at the end of the call.
The client thread will wait on the WaitHandle from IAsyncResult (which is
really a AsyncResult).

My question is, when exactly is this WaitHandle signalled - is it:

-when the asynchronous call finishes
OR
-when EndInvoke() is called (by the callback)

I need to know this, to synchronise the client thread and asynch thread.
This is so the asynch thread knows whether the client thread has timed out.

Is the behaviour the same on all versions of .NET ? (the documentation is
unclear, so it could implemented either way ?)

Thanks,

Sean
Oct 23 '06 #2

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

Similar topics

8
by: axxegfx | last post by:
newbie delegates question i'm using this code: sub empezar() Dim del As MyDelSub Dim del2 As MyDelSub Dim delAll As del = New MyDelSub(AddressOf hilo1) del2 = New MyDelSub(AddressOf hilo2)
3
by: Pietje de kort | last post by:
Hello all, I want to implement Timeout behaviour in a class of mine. When a method is called it should timeout after a few seconds. To do this I've built a System.Threading.Timer that calls a...
1
by: | last post by:
Is there any way to find out: 1. which thread is holding a monitor object? 2. how many Monitor.Enter() has been called on an object? 3. which WaitHandle is signaled after WaitHandle.WaitAny()? ...
3
by: Oscar Thornell | last post by:
Hi, I am thinking about doing all my logging asynchronously using a delegate. The main resaon for this would be performance and responsiveness of the application (an ASP.NET app). //Exampel...
1
by: Tobias Matzat | last post by:
Hi! Is it possible to wait for the callback method to finish? When using a WaitHandle only the call of EndInvoke is awaited. I would like to do some calculations in the callback-method. But I...
3
by: Glen | last post by:
This is my first attempt as asynchronous processing. I have created a small test app as proof of concept, but I am having one proglem. In the example (code listed below), my callback routine has...
11
by: Glen Wolinsky | last post by:
This is my first attempt as asynchronous processing. I have created a small test app as proof of concept, but I am having one proglem. In the example (code listed below), my callback routine has...
2
by: ghost | last post by:
As the Subject indicates I have written a web page that makes use of several web service calls. Some of the web service calls are very fast so they called synchronously. Some web service calls...
0
by: Patino | last post by:
I have a particular WS consumer application (Windows app) that was not able to read an error from the WS app because it was calling a method asynch. The client app just hangs there. But once I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...

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.