Boost logo

Boost :

Subject: Re: [boost] request for interest in a garbage collection library
From: Achilleas Margaritis (axilmar_at_[hidden])
Date: 2009-04-17 04:08:25


Sid Sacek wrote:
>>> It's the lack of a programming model that integrates
>>> destructors and peoples' legitimate expectations that they will be
>>> called to release non-memory resxources. What can you say about the
>>> non-memory resources owned by a GC'd object that contains, say, a
> mutex?
>
>> Personally, I don't see why resources like mutexes or files should be
>> managed like memory. Resources like that are "binary" resources: they
>> have two states (locked/unlocked, opened/closed), which is perfectly
>> suited for RAII.
>
>
> I think the question David was asking is; if a GC object is holding a
> mutex that is currently holding a lock, then when does that lock
> release, or how does that lock release? The GC may run in the future,
> and in the meanwhile, that lock is frozen.
>

Aren't scoped locks a better way to handle such issues? The big
advantage of C++ is scoped construction/destruction.


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