HighTechTalks DotNet Forums  

Multithreading and AppDomains

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Multithreading and AppDomains in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kai Iske
 
Posts: n/a

Default Multithreading and AppDomains - 11-23-2007 , 04:41 AM






Hi,

following situation (this is still .NET 1.1 - *sigh*)

For a scheduling application, I create a Thread for every task that is
due to be executed. Once a task execution is due, a running Thread
will be created. The runner thread in turn will instantiate a
TaskRunner object in a new AppDomain, so it is like that. The
TaskRunner then instantiates the Task class and calls a method on an
interface:

1. Create New Thread
2. Thread creates new AppDomain
3. TaskRunner is created in new AppDomain
4. TaskRunner instantiates task class and executes interface method

2. - 4. all happen on the same (newly created thread)

After the TaskRunner has executed the task method, it cleans up,
however when the Thread calls to unload the AppDomain it previously
created, the whole thread is aborted and no code is executed anymore
after the unload.

I don't quite understand why this would happen. My worker thread runs
on the main AppDomain and creates/unloads a child AppDomain. I wonder
why unloading that child AppDomain would kill my worker thread.

Any help would be highly appreciated.

Thanks

Kai

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.