>> Can I force .NET Remoting to always use a specific thread on the server end to execute requests?
No, but you can queue UI-related tasks to this thread (you will still have to synchronize the access to the underlying queuing data structure), and it can process them asynchronously. At least, that's what came first to my dead brain at 2 am:) Cheers, Stoyan -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Claus Brod Sent: Monday, April 05, 2004 23:58 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Naive question on thread affinity in remoting scenarios Hi all, I'm trying to understand how .NET Remoting works internally, especially with respect to threading. Let's assume that you have some .NET code which acts as a Remoting server. This .NET code internally uses some unmanaged code through either P/Invoke or IJW (i.e. no COM components). This unmanaged code, among other things, creates and manipulates UI components. So when a remote .NET client contacts the .NET server to execute a request, the .NET server will (in some cases) call unmanaged code which deals with UI components. However, those calls will not always be made in the same thread - apparently, .NET remoting uses a thread pool to execute requests. However, thread affinity is required for Windows UI components, i.e. they need to be created and manipulated by one thread only. What's a good strategy to deal with such a situation? Can I force .NET Remoting to always use a specific thread on the server end to execute requests? Thanks! Claus =================================== This list is hosted by DevelopMentor. http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles 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 Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com