Hi Pralay, I don't know if this will work for your specific problem, but you could try this. If all you want to do is abort the "unknown" threads, you could isolate the instance of the third party class to run in its own separate AppDomain, then Unload the AppDomain when you're done using the class. This should terminate the "unknown threads" with the Abort method. Of course this requires that the class can be marshaled by reference (if it's not, you could wrap it in your own MarshalByRefObject class).
-Gert > -----Original Message----- > From: pralay [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 3:19 AM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Accessing child thread from > parent thread > > > Hi Simson, > I'm describing my problem in details. Problem is that: Suppose > somebody(i.e. an user) writes a class in test.cs file and he creates > test.dll. Then he gives his test.dll and he told me the class > name. Then > i'm creating an object of that class by using > Activator.CreateInstanceForm > () method. Then I'm calling one method of that object in a > Thread. That > method creates some threads(class code is not known to me, so > I don't know > what are the Threads created by the method). > Now, suppose I want to Abort() all the threads. How can I do > it? Here, if i > get some kind of handle or ID for all the threads created by > the method > then I can easily do it. > For, example, in java there is a function enumerate() in > thread class which > takes an array of Thread as argument, and this method stores > in that array > all the Thread created by the primary thread. In, C# if there > is something > like that, then I can abort all the Thread created by primary thread. > If you know the answer plz reply. > Thanx. > pralay > > You can read messages from the Advanced DOTNET archive, > unsubscribe from Advanced DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.
