By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Thread won't start

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.