i am building an ASP.NET web project with J#.
I have the problem, that a Threads run() method isn't
invoked after Thread.start().
It's working in one project, but it isn't in an other one.
Are there any settings involved in this ?
regards,
grkanPlease post your code and I'll have a look.
L.
"Grkan Demirci" <fake_email@.host.de> wrote in message
news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
> Hi,
> i am building an ASP.NET web project with J#.
> I have the problem, that a Threads run() method isn't
> invoked after Thread.start().
> It's working in one project, but it isn't in an other one.
> Are there any settings involved in this ?
>
> regards,
> grkan
The code is realy simple to check the behaviour.
static public volatile boolean isStarted = false;
static public void run()
{
isStarted = true;
}
protected void Application_Start(Object sender, System.EventArgs e)
{
System.Threading.Thread t = new System.Threading.Thread(new
System.Threading.ThreadStart(run));
t.set_Priority(System.Threading.ThreadPriority.Low est);
t.Start();
while ( !isStarted );
}
run() is never been invoked. The applications hangs in while(isStarted).
regards,
grkan
"Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
> Please post your code and I'll have a look.
> L.
> "Grkan Demirci" <fake_email@.host.de> wrote in message
> news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
>> Hi,
>>
>> i am building an ASP.NET web project with J#.
>> I have the problem, that a Threads run() method isn't
>> invoked after Thread.start().
>> It's working in one project, but it isn't in an other one.
>>
>> Are there any settings involved in this ?
>>
>>
>> regards,
>>
>> grkan
>>
>>
that won't give you the results you are looking for because the application
start event only fires once. put the code in the page load event of the
webpage or leave the code where it is and re-start IIS. it should work then
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @. www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-----------------
"Grkan Demirci" <fake_email@.host.de> wrote in message
news:unubkzOxFHA.2976@.TK2MSFTNGP10.phx.gbl...
> The code is realy simple to check the behaviour.
> static public volatile boolean isStarted = false;
> static public void run()
> {
> isStarted = true;
> }
> protected void Application_Start(Object sender, System.EventArgs e)
> {
> System.Threading.Thread t = new System.Threading.Thread(new
> System.Threading.ThreadStart(run));
> t.set_Priority(System.Threading.ThreadPriority.Low est);
> t.Start();
> while ( !isStarted );
> }
> run() is never been invoked. The applications hangs in while(isStarted).
> regards,
> grkan
>
> "Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
> news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
> > Please post your code and I'll have a look.
> > L.
> > "Grkan Demirci" <fake_email@.host.de> wrote in message
> > news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
> >> Hi,
> >>
> >> i am building an ASP.NET web project with J#.
> >> I have the problem, that a Threads run() method isn't
> >> invoked after Thread.start().
> >> It's working in one project, but it isn't in an other one.
> >>
> >> Are there any settings involved in this ?
> >>
> >>
> >> regards,
> >>
> >> grkan
> >>
> >>
My guess would be this - you set the thread's priority to lowest then you go
into a tight loop in the main thread. Should you sleep for a milli second or
two in the main thread inside the loop, then the thread should be able to
execute.
"Grkan Demirci" <fake_email@.host.de> wrote in message
news:unubkzOxFHA.2976@.TK2MSFTNGP10.phx.gbl...
> The code is realy simple to check the behaviour.
> static public volatile boolean isStarted = false;
> static public void run()
> {
> isStarted = true;
> }
> protected void Application_Start(Object sender, System.EventArgs e)
> {
> System.Threading.Thread t = new System.Threading.Thread(new
> System.Threading.ThreadStart(run));
> t.set_Priority(System.Threading.ThreadPriority.Low est);
> t.Start();
> while ( !isStarted );
> }
> run() is never been invoked. The applications hangs in while(isStarted).
> regards,
> grkan
>
> "Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
> news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
>> Please post your code and I'll have a look.
>>
>> L.
>>
>> "Grkan Demirci" <fake_email@.host.de> wrote in message
>> news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
>>> Hi,
>>>
>>> i am building an ASP.NET web project with J#.
>>> I have the problem, that a Threads run() method isn't
>>> invoked after Thread.start().
>>> It's working in one project, but it isn't in an other one.
>>>
>>> Are there any settings involved in this ?
>>>
>>>
>>> regards,
>>>
>>> grkan
>>>
>>>
>>
>>
0 comments:
Post a Comment