thread.start() does not actually execute the assigned method

G

Guest

I have an ASP.NET application that creates 4 threads in the Application
OnStart event. Each thread is stored in the Application object collection.

This code works perfectly on my dev machine, running WindowsXPpro with
VS.NET 2003 installed. Each thread is started and goes about its tasks as
expected.

This code fails on a dev Win2K Server. There is no exception thrown. The
methods that should be executed on each of the threads are just not run at
all.

I have attempted to get my dev machine to produce the same outcome by
matching all the user privileges and using the config files from the Win2K
machine, without success.

I have hunted high and low for any information that might point me in the
right direction as to why this is happening, again with no success. Any help
I can get on this one will be greatly appreciated.

Thanks all.
CVC
 
B

Brock Allen

Are you running in a partial trust environment? It's possible that your application
has not been granted sufficient permissions to create and control threads.
 
G

Guest

It has taken me a long time to get back to the forum to update this post. My
apologies for that.

In the end I figured out what the problem was... however, although not an
issue at the moment, I would like to understand why this was a problem, so
any pointers on that would be great.

So, my threads all log information to a database through a logging object.
This object was using the StackTrace object to establish the calling class
and method rather than every call to the logging object having to provide the
info. This code was the problem, without it everything worked perfectly.

So, I found where the problem was and fixed it. However I don't understand
why accessing the StackTrace would cause this problem. Can anyone help me
out on that?

Thanks all.
CVC
 
G

Guest

Thanks for you response Brock. Sorry it has taken me so long to get back to
you. I have updated the main thread with where I am at.

How do I tell if I am running in a partial trust environment? Can you point
me at some good www sites to do a some reading on the topic?

Thanks again.
Chris
 
Joined
Jun 10, 2007
Messages
1
Reaction score
0
Thanks for highlighting the link to StackTrace.
I also have come across this problem with a standard .NET windows application.
I had used StackTrace in writing to a trace log. When running in the IDE, for debug or release builds, everything works fine.
However when runnning a release build from windows explorer it misbehaves. It fails to start a particular thread (some others seem to work ok, I think). The thread uses code such as :

othreadstart = new threadstart(addressof myfunc)
oThread = new thread(othreadstart)

the function (myfunc) is never called !

What a git of a bug!http://www.velocityreviews.com/forums/images/icons/icon8.gif
Angry
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top