Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2003-07-11 16:40:17


John Madsen wrote:

> Starting from the smart_ptr headers (shared, scoped, and weak), I've
> created corresponding handle classes. The motivation is to provide
> RAII semantics for handle based resources. Windows' HANDLEs,
> FILE*s, and file descriptors are the most obvious examples.

[snip]

>
> I'd certainly love to hear ideas, criticism, etc. and ultimately see
this
> become part of boost.

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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk