Re: Serious concurrency problems on fast systems
On 6/2/2010 4:19 PM, ClassCastException wrote:
On Wed, 02 Jun 2010 15:07:52 -0400, Eric Sosman wrote:
On 6/2/2010 1:28 PM, ClassCastException wrote:
On Wed, 02 Jun 2010 11:01:06 -0400, Eric Sosman wrote:
The "I've just acquired a lock; please don't slice me yet" hint
is independent of priority inheritance.
Could this be a use for Thread.yield()? Yield just before acquiring a
lock, maybe less likely to get a context switch during the critical
section since the C.S. will be entered right at the start of your next
slice?
You seem to be making a lot of assumptions about how the
scheduler works.
No; the only assumption being made is that the shorter the interval since
a thread has resumed, the lower the probability of its being preempted in
the next x nanoseconds for some fairly small value of x. I don't think
that that's an unreasonable assumption; context switches are expensive
enough that a reasonably-designed OS scheduler is probably going to avoid
frequently putting two of them (on the same core) too close together in
time.
Dear Sir or Madam (as the case may be),
You may be right, at that.
Sincerely,
E.A.S.
(With apologies to George Bernard Shaw.)
--
Eric Sosman
esosman@ieee-dot-org.invalid