Home All Groups Group Topic Archive Search About

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

Author
27 Apr 2005 8:27 PM
chrisvc
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

Author
27 Apr 2005 9:32 PM
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
Are all your drivers up to date? click for free checkup

Author
14 May 2005 5:10 AM
chrisvc
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

Show quoteHide quote
"chrisvc" wrote:

> 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
>
Author
14 May 2005 5:13 AM
chrisvc
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

Show quoteHide quote
"Brock Allen" wrote:

> 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.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > 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
>
>
>
>

Bookmark and Share