[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GH replacement proposal (includes a bit of Unicode)
From: |
Andreas Rottmann |
Subject: |
Re: GH replacement proposal (includes a bit of Unicode) |
Date: |
Fri, 23 Apr 2004 19:36:41 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Marius Vollmer <address@hidden> writes:
>> I'm a little wary of the locking, especially global locking, but I
>> suppose it may well be necessary. I don't have a strong feeling
>> either way offhand, but presuming for the moment that it is necessary,
>> then is there any way to lock down a particular value rather than the
>> entire heap?
>
> Having a lock for every object would have a high overhead and give you
> very little in terms of performance, I guess. Also, they would be
> tricky to use.
>
Why would the overhead be significantly larger than for one object?
Pika will have per-object locks, and I think the implementation chosen
has little overhead over global locking.
> When you need to lock two objects, there would be the danger of
> deadlocks, when other code needs to lock the exact same two objects,
> but does it in reverse order.
>
You could probably solve this by having an poeration that does an
"atomic" lock of serveral objects. Naive algorithm:
1) lock all objects you can
2) if that's all:
fine
else:
release all objects locked previously, wait a bit and goto 1)
> You would also have to allow locking an object twice, further
> increasing overhead.
>
Why do you need to lock an object twice?
Andy
--
Andreas Rottmann | address@hidden | address@hidden | address@hidden
http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
Say NO to Software Patents! -- http://petition.eurolinux.org/
- Re: GH replacement proposal (includes a bit of Unicode), (continued)