Re: temporary disable thread switching using pthreads



That's not quite I mean. What I mean is this:

1) Thread A requests exclusivity.

2) Thread B is at a safe point, and stops, waiting for A to release it.

3) Thread C is not at a safe point and is still running, but it needs
thread B to do something before it can continue. (For example, it's
trying to put some data on a queue but the queue is full and thread B's
job is to service the queue. There are many other examples.)

4) Thread A cannot proceed until thread C hits a safe point. Thread C
cannot proceed until thread B makes forward progress. Thread B is
stopped until thread A proceeds.

To make the exclusivity system work, you must detect such a deadlock
and release all threads only to start over.

DS

.



Relevant Pages

  • Re: Thread#raise, Thread#kill, and timeout.rb are unsafe
    ... Thread#raiseenqueue exc to the queue. ... Thread.check_interruptchecks an exception which is ... Thread.check_interrupt is a safe point. ... Blocking operations, such as I/O, may or may not be safe ...
    (comp.lang.ruby)
  • Re: Thread#raise, Thread#kill, and timeout.rb are unsafe
    ... asynchronous events should be queued. ... Thread#raiseenqueue exc to the queue. ... However safe points is not only Thread.check_interrupt. ... Blocking operations, such as I/O, may or may not be safe ...
    (comp.lang.ruby)
  • Re: Fascist cyclists
    ... is a *long* queue (one or two cars doesn't count as a long queue ... but I will move over if they have been behind for a significant time) ... and it as safe and appropriate to pull over. ...
    (uk.transport.london)
  • Re: Cyclists to be above the law - official
    ... over (when and where it is safe) to let any queue behind them to ... "Do not hold up a long queue of traffic, ... In towns it is the motorists who cause the queues. ... longer delays for them are rare. ...
    (uk.legal)
  • Re: updating an ImageIcons backing BufferedImage content from multiple threads
    ... Swing's version does have an explicit guarantee. ... does say that the method should be used by other threads to execute code on the EDT; it doesn't actually say that it's safe to do so. ... the bit about "happen after all pending events are processed" to me just implies that somewhere there's a queue with a lot of Runnables in it. ...
    (comp.lang.java.programmer)