Trouble getting thread to start from global.asax

N

Nathan

I'm trying to start a thread from the Application_Start event in
Global.asax. The thread is supposed to run some code, store the time it
ran in the database and then sleep for 24 hours.

My code is:
Dim jb as New DailyJob
Dim td as Thread
td = New Thread(AddressOf jb.Start)
td.Start()

My DailyJob class runs fine it I just normally execute it, but if I put
Trace.Write(Thread.ThreadState.ToString) it displays "Unstarted". Also,
if I place Trace.Writes in the constructor and Start method of the
DailyJob class they never display.

What would be causing my thread not to start, and is there any way of
checking if its active (something like
System.Threading.IsThreadActive(ThreadName))?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top