By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,018 Members | 870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,018 IT Pros & Developers. It's quick & easy.

Async Methods, Callback (What Thread)

P: n/a
hello

I have implemented a solution using async methods. There is one async
method that can be invoked multiple times, ie there are multiple async
"threads" running at a time.

When these threads are complete, the call the Callback method. Each "thread"
calls the same callback method.

What thread does this callback method exist on? My testing indicates the
callback method is not blocked when executed from a given thread when it
completes.

For example thread 1 can execure it's callback , while thread 2 executes
it's callback. No blocking seems to occur.

Any help getting me to understand this would be appreciated.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Scott,

I think the CallBack function is reentrant, i.e. each thread that calls the
callback function will have its own function call back stack. Therefore the
this callback method exist on every thread that call the function. If you
want to program multithread application, you may need to synchronize the
data that will be access by the callback function.

Here is a link about Synchronizing Data for Multithreading.
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconmanagedthreadingsupport.asp
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "scott ocamb" <so****@hotmail.com>
Subject: Async Methods, Callback (What Thread)
Date: Fri, 8 Aug 2003 13:02:56 -0400
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eD**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 64.241.196.2
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103985
X-Tomcat-NG: microsoft.public.dotnet.general

hello

I have implemented a solution using async methods. There is one async
method that can be invoked multiple times, ie there are multiple async
"threads" running at a time.

When these threads are complete, the call the Callback method. Each "thread"calls the same callback method.

What thread does this callback method exist on? My testing indicates the
callback method is not blocked when executed from a given thread when it
completes.

For example thread 1 can execure it's callback , while thread 2 executes
it's callback. No blocking seems to occur.

Any help getting me to understand this would be appreciated.


Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.