The implementation for BeginInvoke and EndInvoke comes from COMDelegate::GetInvokeMethodStub (clr\src\vm\prestub.cpp).
The actual code is emitted in CTPMethodTable::CreateDelegateStub (clr\src\VM\i386\remotingx86.cpp). -Jan -----Original Message----- From: Discussion of the Rotor Shared Source CLI implementation [mailto:[EMAIL PROTECTED] On Behalf Of Wei Chen Sent: Wednesday, July 07, 2004 4:44 PM To: [EMAIL PROTECTED] Subject: [DOTNET-ROTOR] Questions about BeginInvoke and EndInvoke Hi, Could someone help me understand how asynchronous calls are implemented in ROTOR? My understanding is that when the C# compiler sees a delegate declaration in the user program, it will automatically create a MulticastDelegate-derived class and supply the definitions for BeginInvoke() and EndInvoke(). Looking at the disassembler output of a C# program, however, I find that the body of the BeginInvoke() method is empty, and the method signature has a "runtime managed" attribute. Does this mean that the method body of BeginInvoke() will be automatically provided by the runtime when the class is loaded? Where can I find the code that implements the methods? Debugger trace seems to suggest that BeginInvoke() calls ThreadpoolMgr::QueueUserWorkItem() to schedule the function execution, while EndInvoke() eventually blocks in Thread::DoAppropriateWaitWorker(). Thanks, Wei =================================== This list is hosted by DevelopMentor(r) http://www.develop.com ASP.NET courses you may be interested in: Guerrilla ASP.NET 15 March 2004, in Boston, MA 17 May 2004 in Torrance, CA 7 June 2004, London, UK http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorŪ http://www.develop.com ASP.NET courses you may be interested in: Guerrilla ASP.NET 15 March 2004, in Boston, MA 17 May 2004 in Torrance, CA 7 June 2004, London, UK http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com