|
Boost : |
From: John Madsen (johnmadsen_usenet_at_[hidden])
Date: 2003-07-18 16:29:15
Larry Evans <jcampbell3_at_[hidden]> wrote:
>
>wouldn't deadlock detection be another application? Taking the
>definition directly from my "long-ago" OS course memory, a deadlock
>occurs when one task or process holds a "handle" to a lock on a
>resource required by another task, which in turn, holds another
>"handle" to a lock on another resource required by first task. If a
>task cannot acquire the resource after a certain amount of time, it
>might try to find whether another task is holding that resource. Now,
>if all the "handles" record their location in memory using Detlef's
>method for smart pointers (and implemented in boost files under
>shared_cyclic_ptr), wouldn't this make it possible for a task to do
>this?
>
I haven't looked much at the cyclic pointer classes, so I'm not sure exactly
how this would work in the cases of handles. My inclination, though, is that
this issue would be better addressed in the thread library. I had in mind that
smart_handle would perform a fairly simple task across a very wide variety of
handles. For many of those handle types deadlock detection doesn't make any
sense. Perhaps, though, I'm missing the point entriely.
John
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk