G
Guest
Hi,
I’ve written a C# console app that does a lot of things simultaneously. The
device being used is an FB6500 (http://www.fabiatech.com/products/fb6500.htm)
running Windows CE 5.0. These are all the things the app does:
1. Uses four threads to scan four COM ports – each port processes real time
data composed of packets. These packets are on average 25 bytes long and
throughput is around 15 packets/sec. So all ports combined process 60
packets/sec.
2. Opens two network sockets – 1 for sending data and another for receiving.
The receiving socket listens for incoming commands from a connected client.
3. Uses 3 timers – one which runs every 10 seconds sends 1500 bytes of data
through a socket to a connected client, another which runs every minute
checks the status of certain variables, and the third runs every hour and
uses RDA (remote data access) to synchronize a remote SQL Server 2000
database.
4. Keeps a log of things that may happen by keeping a file open and writing
to it when necessary.
I also need to run a client on a desktop PC which connects to the listening
socket of the app on the device. This client simply receives the 1500 bytes
of data every ten seconds and updates a form. When running the app on the
device, it works fine functionally but I have noticed that a lot of times the
console app freezes after a while (the mouse is still movable but I can’t
press anything, the system time at the bottom right corner also freezes). I
ran it overnight last night and this morning when I checked it, it was still
running. I then ran it again and after 20 mins or so it freezes. The amount
of time it takes until it freezes is unpredictable. The funny thing is when
running it under VS.NET debug mode, after the app freezes, the serial
processing is still taking place, it’s the networking stuff that’s stopped
(i.e. the client no longer receives the 1500 bytes every ten secs). Would the
number of threads running cause this freezing to take place? I honestly don’t
know where to begin to fix this problem. My app NEEDS to run for long periods
of time (i.e. over 12 hours). Can anyone shed any light on what might be
causing this or where I should start looking? Thanks in advance.
Kind Regards,
Michael--J
I’ve written a C# console app that does a lot of things simultaneously. The
device being used is an FB6500 (http://www.fabiatech.com/products/fb6500.htm)
running Windows CE 5.0. These are all the things the app does:
1. Uses four threads to scan four COM ports – each port processes real time
data composed of packets. These packets are on average 25 bytes long and
throughput is around 15 packets/sec. So all ports combined process 60
packets/sec.
2. Opens two network sockets – 1 for sending data and another for receiving.
The receiving socket listens for incoming commands from a connected client.
3. Uses 3 timers – one which runs every 10 seconds sends 1500 bytes of data
through a socket to a connected client, another which runs every minute
checks the status of certain variables, and the third runs every hour and
uses RDA (remote data access) to synchronize a remote SQL Server 2000
database.
4. Keeps a log of things that may happen by keeping a file open and writing
to it when necessary.
I also need to run a client on a desktop PC which connects to the listening
socket of the app on the device. This client simply receives the 1500 bytes
of data every ten seconds and updates a form. When running the app on the
device, it works fine functionally but I have noticed that a lot of times the
console app freezes after a while (the mouse is still movable but I can’t
press anything, the system time at the bottom right corner also freezes). I
ran it overnight last night and this morning when I checked it, it was still
running. I then ran it again and after 20 mins or so it freezes. The amount
of time it takes until it freezes is unpredictable. The funny thing is when
running it under VS.NET debug mode, after the app freezes, the serial
processing is still taking place, it’s the networking stuff that’s stopped
(i.e. the client no longer receives the 1500 bytes every ten secs). Would the
number of threads running cause this freezing to take place? I honestly don’t
know where to begin to fix this problem. My app NEEDS to run for long periods
of time (i.e. over 12 hours). Can anyone shed any light on what might be
causing this or where I should start looking? Thanks in advance.
Kind Regards,
Michael--J