473,799 Members | 3,017 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(Col lect));
thrd.Name = "Comm Port Reader";
thrd.Priority = ThreadPriority. Highest;
thrd.IsBackgrou nd = true;
thrd.Start();
Thread.Sleep(10 );
if (!thrd.IsAlive)
{
MessageBox.Show ("thread failed to start");
MessageBox.Show ("ThreadStat e: "+thrd.ThreadSt ate.ToString()) ;
}
}
catch(Exception e)
{
MessageBox.Show (e.Message);
}

Feb 9 '07 #1
4 4121
Phil <Ph**@discussio ns.microsoft.co mwrote:
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.co m>
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**@discussio ns.microsoft.co mwrote:
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.co m>
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
1049
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 the same development environments, code, and third-party components. Nothing is different except the development computer. If I use my test app, written in C#, to "drive" the DLL, the thread starts and the program works flawlessly on the Dell. ...
23
6549
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 queue, grab it and run a system command. Now I want to make sure that system command doesn't hang forever, so I need some way to kill the command and have the worker thread go back to work waiting for another queue entry.
5
4032
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 method TestThread increments a number in the textbox on the form. TestThread is called from a worker thread (2nd thread) using a TimerThread.
12
2336
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 object's state and generate classe's A events "Connected" and "Disconnected". It looks something like this: "
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 the job. Application contains one list of agents that are idle at the moment and list of busy agents. In loop it checks if there are agents in idle list and if there are some, it starts them.
5
1633
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 in a web service implemented using C#, ASP.NET 1.1, IIS 5.1, Windows 2000 Server.
8
1628
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, so I decided to put it on a thread. The thread works, but not the way it should. One of my page will start the thread, and then forward the user to another page. The thread will start, and browser will get forwarded to the next page, BUT as...
5
2221
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 MainForm what has a Start/Stop button that starts and stops the processing thread. private void StartButton_Click(object sender, System.EventArgs e) { if( bStopSignal ) { // disable controls that aren't valid when running
0
1088
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 possible to make it run all the time to do monitor job? For me, looks like it works on my machine. But when I put it to the my webhost, public it, it won't work. It did not run into the thread at all. And It did not say any error about new thread...
0
1531
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 threading import Thread import thread class testThread(Thread): def __init__ (self, id): Thread.__init__(self) self.id = id def run(self):
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7563
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.