473,414 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Thread not starting

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,

gürkan
Nov 19 '05 #1
4 1132
Please post your code and I'll have a look.

L.

"Gürkan Demirci" <fa********@host.de> wrote in message
news:Oj****************@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,

gürkan

Nov 19 '05 #2
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,

gürkan

"Landley" <ne**@creations-software.co.uk> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP15.phx.gbl...
Please post your code and I'll have a look.

L.

"Gürkan Demirci" <fa********@host.de> wrote in message
news:Oj****************@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,

gürkan


Nov 19 '05 #3
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
-------------------------------------------------------

"Gürkan Demirci" <fa********@host.de> wrote in message
news:un**************@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,

gürkan

"Landley" <ne**@creations-software.co.uk> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP15.phx.gbl...
Please post your code and I'll have a look.

L.

"Gürkan Demirci" <fa********@host.de> wrote in message
news:Oj****************@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,

gürkan



Nov 19 '05 #4
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.

"Gürkan Demirci" <fa********@host.de> wrote in message
news:un**************@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,

gürkan

"Landley" <ne**@creations-software.co.uk> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP15.phx.gbl...
Please post your code and I'll have a look.

L.

"Gürkan Demirci" <fa********@host.de> wrote in message
news:Oj****************@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,

gürkan



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Olivier Parisy | last post by:
Hi, I like to use thread to simplify the handling of independant, blocking tasks. But controling them from a main thread is not always easy to do in a clean way. So I've written some generic...
9
by: phil | last post by:
And sorry I got ticked, frustrating week >And I could help more, being fairly experienced with >threading issues and race conditions and such, but >as I tried to indicate in the first place,...
4
by: cedric | last post by:
hello, I encounter a problem using threads. I have a simple code to use a thread : cSurveillanceBorne = New clsThreadSurveillance _SurveillanceThread = New Thread(AddressOf...
7
by: Ivan | last post by:
Hi I have following problem: I'm creating two threads who are performing some tasks. When one thread finished I would like to restart her again (e.g. new job). Following example demonstrates...
8
by: JS | last post by:
I am monitoring/controlling some realtime activities in a manufacturing process. When a part comes into my station, I have a bunch of processing to do. There are 30-40 data acquisition and data...
5
by: taylorjonl | last post by:
I am completely baffled. I am writting a daemon application for my work to save me some time. The application works fine at my home but won't work right here at work. Basically I have a...
5
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
3
by: NaeiKinDus | last post by:
Hello, i'm trying to program a thread that would be locked (by a mutex) and that would only be unlocked once that a function (generating data) is done. The purpose is to generate data, and unlock...
16
by: Hendrik van Rooyen | last post by:
I thought I would share this nasty little gotcha with the group. Consider the following code fragment: <start> print 'starting kbd thread' keyboard_thread = thread.start_new_thread(kbd_driver...
6
by: Lars Uffmann | last post by:
In an event routine, I want to end a certain thread. I am setting a flag that is checked by the thread and causes it to end, when it is set. Then the thread sets a "response" flag, just before...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.