Re: Console app freezes
From: Michael--J (MichaelJ_at_discussions.microsoft.com)
Date: 12/16/04
- Next message: Daniel Moth: "Re: unhandled exception of type 'System.TypeLoadException'"
- Previous message: sam.cartner: "Re: unhandled exception of type 'System.TypeLoadException'"
- In reply to: Ilya Tumanov [MS]: "Re: Console app freezes"
- Next in thread: Ilya Tumanov [MS]: "Re: Console app freezes"
- Reply: Ilya Tumanov [MS]: "Re: Console app freezes"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 03:17:08 -0800
Thanks for your quick reply. I see what you are getting at. But how would a
race condition cause a hang? I thought it usually just corrupts the proper
value of an object or variable.
I'm getting quite worried because i have been working on this app for quite
some time now and to find out it can't last for long periods of time is
really disappointing. I just want to make sure whether things like this are
fixable or if it's inherent with running multithreaded apps on
resource-contrained devices. It's just very wierd that sometimes it runs for
hours (it ran for 10 hours once) and at other times it freezes after 20, or
30 mins or so. I'll have a look and see if i can find any race conditions.
Thanks in advance.
Michael--J.
"Ilya Tumanov [MS]" wrote:
> You probably have a race condition somewhere; this is the common reason for
> multithreaded applications to hang.
>
> Make sure all shared (between threads) objects are properly locked/unlocked.
>
>
>
> Best regards,
>
>
>
> Ilya
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Michael--J" <MichaelJ@discussions.microsoft.com> wrote in message
> news:2A88D523-2302-4891-943E-2170F347100A@microsoft.com...
> > 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
>
>
>
- Next message: Daniel Moth: "Re: unhandled exception of type 'System.TypeLoadException'"
- Previous message: sam.cartner: "Re: unhandled exception of type 'System.TypeLoadException'"
- In reply to: Ilya Tumanov [MS]: "Re: Console app freezes"
- Next in thread: Ilya Tumanov [MS]: "Re: Console app freezes"
- Reply: Ilya Tumanov [MS]: "Re: Console app freezes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|