HighTechTalks DotNet Forums  

Re: ThreadStart method problem?

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Re: ThreadStart method problem? in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Alvin Bruney [MVP - ASP.NET]
 
Posts: n/a

Default Re: ThreadStart method problem? - 05-15-2005 , 01:43 PM






Chances are that the thread starts but fails to complete. Exceptions
occuring in a thread are not propagated back to the caller unless explicitly
told to do so. Put a break point in DoListen and step thru it to see what
the problem is.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"ram mohan via .NET 247" <anonymous (AT) dotnet247 (DOT) com> wrote

Quote:
Hi,

I am using using ThreadStart to create three threads that run a worker
process, and then call Start on the threads. These 2 statemetns are
executed properly but the worked method is not being started!.


{
Thread[] listenerThreads;
WorkerClass[] listener;

..... more initialisation code here

listenerThreads[i]=new Thread(new ThreadStart(listeners[i].DoListen)); -
(1)
listenerThreads[i].Start(); -> (2)
string isAlive = listenerThreads[i].IsAlive.ToString(); -> (3)
string ThreadState = listenerThreads[i].ThreadState.ToString(); -> (4)
....
}

all 1-4 statements are executed with out any exception but the thred does
not get startedd (the DoListen() is never called since some print
statements in this functions are not executed). The isAlive is 'true' and
ThreadState is 'Unstarted'.

I a running this app on a dual processor machine. The same code base and
app was running properly on other production servers but when installed on
a new server the Dolisten() method never gets invoked.

Any clues what can be the problem?

Thanks a zillion in adv,
Ram.


--------------------------------
From: ram mohan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

Id>K7QPlbEdPEiw9VXycsYfOg==</Id



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 - 2009, Jelsoft Enterprises Ltd.