On Dec 10, 2:09 pm, Duncan Booth wrote:
> Darren Dale wrote:
> > On Dec 10, 11:19 am, Duncan Booth
> > wrote:
> >> Darren Dale wrote:
> > def get_data(oid):
> > with reglock:
> > data = registry.get(oid, None)
> > if data is None:
> > data = make_data(oid)
> >
Darren Dale wrote:
> On Dec 10, 11:19 am, Duncan Booth
> wrote:
>> Darren Dale wrote:
> def get_data(oid):
> with reglock:
> data = registry.get(oid, None)
> if data is None:
> data = make_data(oid)
> registry[oid] = data
> return data
>
> Does t
On Sunday, December 11, 2011 1:56:38 AM UTC+8, Darren Dale wrote:
> On Dec 10, 11:19 am, Duncan Booth
> wrote:
> > Darren Dale wrote:
> > > I'm concerned that this is not actually thread-safe. When I no longer
> > > hold strong references to an instance of data, at some point the
> > > garbage co
On Dec 10, 11:19 am, Duncan Booth
wrote:
> Darren Dale wrote:
> > I'm concerned that this is not actually thread-safe. When I no longer
> > hold strong references to an instance of data, at some point the
> > garbage collector will kick in and remove that entry from my registry.
> > How can I ens
Darren Dale wrote:
> I'm concerned that this is not actually thread-safe. When I no longer
> hold strong references to an instance of data, at some point the
> garbage collector will kick in and remove that entry from my registry.
> How can I ensure the garbage collection process does not modify