Thread won't start

G

Guest

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);
}
 
J

Jon Skeet [C# MVP]

Phil said:
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?
 
G

Guest

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
 
J

Jon Skeet [C# MVP]

Phil said:
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?
 
G

Guest

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
 

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

Top