Re: [linux-audio-dev] Article about multithreading

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Article about multithreading
From: Paul Davis (pbd_AT_Op.Net)
Date: Sun Jun 17 2001 - 23:54:11 EEST


>> deadlock avoidance is an bit of an illusory goal. there has been some
>> mostly theoretical work on such things, but once again, you lose
>> performance (a lot, if you use mutexes a lot), and in general, a
>> pathological situation can still cause deadlocks that were not found
>> by an analytical stage.
>
>
>Just how bad is this performance penalty ?
>Setting a mutex shouldn't be that bad ?

setting a mutex doesn't cost. handling deadlock costs a lot. you have
to be able to unwind contexts, release locks, traverse trees of lock
holders, etc. i was involved in writing a system that did part of this
about, oh, 7 or 8 years ago, and it was really a nightmare. every time
you acquire or release a mutex, you have to do a bunch of extra
work.

its hard for me to think of a situation in which it would make sense
to pay the run-time cost rather than spend compile-time cost involving
good programmer with a decent lock analysis tool (regretably,
something linux doesn't have and solaris does) to figure out the
deadlocks. and anyway, once you've done this stuff a half-dozen times,
most deadlocks are easy to figure out.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sun Jun 17 2001 - 23:54:28 EEST