Re: The reliability of python threads



Aahz wrote:
In article <mailman.3166.1169752349.32031.python-list@xxxxxxxxxx>,
Carl J. Van Arsdall <cvanarsdall@xxxxxxxxxx> wrote:
My point is that an app that dies only once every few months under load
is actually pretty damn stable! That is not the kind of problem that
you are likely to stimulate.

This has all been so vague. How does it die?

It would be useful if Python detected obvious deadlock. If all threads
are blocked on mutexes, you're stuck, and at that point, it's time
to abort and do tracebacks on all threads. You shouldn't have to
run under a debugger to detect that.

Then a timer, so that if the Global Python Lock
stays locked for more than N seconds, you get an abort and a traceback.
That way, if you get stuck in some C library, it gets noticed.

Those would be some good basic facilities to have in thread support.

In real-time work, you usually have a high-priority thread which
wakes up periodically and checks that a few flags have been set
indicating progress of the real time work, then clears the flags.
Throughout the real time code, flags are set indicating progress
for the checking thread to notice. All serious real time systems
have some form of stall timer like that; there's often a stall
timer in hardware.

John Nagle
.



Relevant Pages

  • Re: ??? Error TimerFcn: Index exceeds matrix dimensions.
    ... On opening, the figure starta timer ... > With the default setting of the NextPlot axes property, ... > because obj doesn't have a first element. ... I see what I want to see in real time. ...
    (comp.soft-sys.matlab)
  • Re: Is it possibe to generate interrupts from OS timers ?
    ... i am so concerned about getting hard real time performance. ... I think i read before that the Windows Multimedia timer cannot guarantee ... The use of timer interrupts seems to give the best guarantee ... I know of other board vendors, like Applied Data Systems, that can ...
    (microsoft.public.windowsce.app.development)
  • Re: Re-entrancy???
    ... know about the need to change the timer interval. ... I really didn't think that he was doing a critical process in real time. ... The OP wasn't against the use of Sleep, but he undestood that using Sleep ... means to remove Doevents. ...
    (microsoft.public.vb.general.discussion)
  • Re: [PATCH 1/1] driver: Tpm hardware enablement
    ... and then start sleeping, but please do sleep for a real time, not just ... Also the timer handling looks suspect... ... the kernel fs layer keep track of this? ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Java or C++?
    ... >>>There are gcol algorithims that don't impact real time performce. ... > many ways to fool yourself that you aren't polling when you are. ... > the tasks running wake up, check those flags, then give up their timeslice ... > the CPU, and that time can be used as I mentioned. ...
    (comp.programming)