473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Thread won't start

I have a dll that I call to start a thread that will monitor a serial port
and then process and store the data received from that port.

On most every computer I have run this on, the program works perfectly.
However, I have a Panasonic CF-51 laptop that fails when I try to launch the
thread.
It works on other CF-51's, it only fails on this particular computer.

I get no exceptions; it simply reports the threadstate as Stopped.

This was developed on VS 2003 running .NET Framework 1.1.

Any ideas??

My code is as follows:

try
{
thrd = new Thread(new ThreadStart(Collect));
thrd.Name = "Comm Port Reader";
thrd.Priority = ThreadPriority.Highest;
thrd.IsBackground = true;
thrd.Start();
Thread.Sleep(10);
if (!thrd.IsAlive)
{
MessageBox.Show("thread failed to start");
MessageBox.Show("ThreadState: "+thrd.ThreadState.ToString());
}
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}

Feb 9 '07 #1
4 4107
Phil <Ph**@discussions.microsoft.comwrote:
I have a dll that I call to start a thread that will monitor a serial port
and then process and store the data received from that port.

On most every computer I have run this on, the program works perfectly.
However, I have a Panasonic CF-51 laptop that fails when I try to launch the
thread.
It works on other CF-51's, it only fails on this particular computer.

I get no exceptions; it simply reports the threadstate as Stopped.
Do you have any logging etc in the created thread? Have you tried
making it a thread which does nothing but log some diagnostics to a
file and then quit?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 10 '07 #2
Yes, I put a statement at the very beginning and it is never executed. I
have read elsewhere that someone else had a similar problem with an ASP.NET
app and they found out that it was a missing DLL. However, I have confirmed
the presence of every DLL indicated as being loaded in the debug mode and
that doesn't appear to be the problem. Unfortunately, since it has only
occurred on one or two of at least 50 different computers, I can only assume
that it is some type of an install problem. Can you recommend any method of
determining what is causing this error?

Thanks,

Phil
Feb 11 '07 #3
Phil <Ph**@discussions.microsoft.comwrote:
Yes, I put a statement at the very beginning and it is never executed. I
have read elsewhere that someone else had a similar problem with an ASP.NET
app and they found out that it was a missing DLL. However, I have confirmed
the presence of every DLL indicated as being loaded in the debug mode and
that doesn't appear to be the problem. Unfortunately, since it has only
occurred on one or two of at least 50 different computers, I can only assume
that it is some type of an install problem. Can you recommend any method of
determining what is causing this error?
Can you start threads from a very simple console app which does nothing
other than starting the new thread?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 11 '07 #4
I see where you are going. I can't test that out right now, but it is
noteworthy that the same dll has a second interface that performs the same
basic startup procedures as the one that doesn't work and it works just fine,
so I guess it couldn't be a missing DLL.

I guess I'll have to give this some more thought.

Thanks for your help and let me know if you have any other suggestions.

Phil
Feb 12 '07 #5

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

Similar topics

0
1036
by: Phil | last post by:
I recently replaced my Toshiba 6100 laptop running XP Pro with a Dell Latitude D810 running XP Pro; since that time an application that I developed over a year ago has stopped working. I am using...
23
6480
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
5
4007
by: Serge | last post by:
Hi, I am having a thread hang problem in my c# code. The example on the website: http://csharp.web1000.com/ is a simplified version of my problem. You will see in the form that a...
12
2301
by: Ricardo Pereira | last post by:
Hello all, I have a C# class (in this example, called A) that, in its constructor, starts a thread with a method of its own. That thread will be used to continuously check for one of its...
7
439
by: Ivan | last post by:
Hi there My work on threads continues with more or less success. Here is what I'm trying to do: Class JobAgent is incharged for some tasks and when it's called it starts thread which performs...
5
1620
by: Doug Kent | last post by:
Hi, I am using a STA thread to run a COM object. On a couple of machines the thread runs fine. On another machine the thread won't start, and no exceptions are thrown. This code is running...
8
1612
by: Jason Chu | last post by:
I have a webpage which uploads a big file onto access db. if the file is say around 30 megs, it'll take around a minute for it to get put into the access db. I didn't want the user to wait for it,...
5
2200
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...
0
1070
by: Nick | last post by:
hi, I have a asp.net project. I want to start a thread in this project at some point to do some operations on database.Is there a limitation on this thread about how long it could run? Is it...
0
1516
by: Yue Fei | last post by:
I have a multi thread python code, threads can start immediately if I run on command line, but I can get them started right the way if I call the same code from C/C++. test code like this: from...
0
7228
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
7393
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...
1
7058
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
5635
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,...
1
5057
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
4715
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...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.