Closed
Bug 503134
Opened 15 years ago
Closed 15 years ago
VMPI locking api using heap allocations is problematic and sub-optimal
Categories
(Tamarin Graveyard :: Garbage Collection (mmGC), defect)
Tamarin Graveyard
Garbage Collection (mmGC)
Tracking
(Not tracked)
VERIFIED
FIXED
flash10
People
(Reporter: treilly, Assigned: treilly)
References
Details
Attachments
(2 files)
28.82 KB,
patch
|
lhansen
:
review+
|
Details | Diff | Splinter Review |
3.88 KB,
patch
|
lhansen
:
review+
|
Details | Diff | Splinter Review |
We should go back to having clients declare the space for the lock (ie a vmpi_spin_lock_t) and passing the address of it to the lock functions. Ie: vmpi_spin_lock_t* VMPI_lockCreate -> void VMPI_lockCreate(vmpi_spin_lock_t *l); void VMPI_lockDestroy(vmpi_spin_lock_t *l); void VMPI_lockAcquire(vmpi_spin_lock_t *l); void VMPI_lockRelease(vmpi_spin_lock_t *l); Also propose to move win32 specific locking diagnostics into platform agnostic code to all platforms benefit.
Comment 1•15 years ago
|
||
What is problematic and sub-optimal about it?
Assignee | ||
Comment 2•15 years ago
|
||
a) it introduces heap allocations where previously we had none b) the allocator itself uses these locks making shutdown complicated (right now we free all memory then call lockDestroy in GCHeap which I can't believe isn't crashing) c) in the player there are cases where a lock is acquired and they delete the heap while they have the lock (to prevent two thread from trying to delete the heap), this is crashing In general tying a low level construct like a lock to heap allocation instead of giving flexibilty to the client on where the lock lives seems unnecessarily limiting and is contrary to all existing OS locking APIs that I know of.
Assignee | ||
Comment 3•15 years ago
|
||
Attachment #388467 -
Flags: review?(lhansen)
Updated•15 years ago
|
Attachment #388467 -
Flags: review?(lhansen) → review-
Comment 4•15 years ago
|
||
Comment on attachment 388467 [details] [diff] [review] First cut, still needs sandbox testing. Fixed SpinLockSymbian line endings. r- only because the change to WinPortUtils is unacceptable without further explanation (you remove the comment that explained why that code was the way it is, and there were two instances in the code of this pattern - the other is MMgcPortWin.cpp:491). Otherwise this looks OK.
Assignee | ||
Comment 5•15 years ago
|
||
The comment referred to a warning about constructing an object and I removed the object so the comment was obsolete. Let me if you think I should add some comment back in....
Comment 6•15 years ago
|
||
Comment on attachment 388467 [details] [diff] [review] First cut, still needs sandbox testing. Fixed SpinLockSymbian line endings. If you've tested it in the Player and there's no warning then I'm fine with it, but then please fix MMgcPortWin.cpp too :-)
Attachment #388467 -
Flags: review- → review+
Assignee | ||
Comment 7•15 years ago
|
||
Pushed changeset: 2138:e5f4ee8c714a
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•15 years ago
|
||
Extra change required to get solaris to pass, can't assume all locks are void * and each platform needs its own vmpi_spin_lock_t def.
Attachment #388948 -
Flags: review?(lhansen)
Updated•15 years ago
|
Attachment #388948 -
Flags: review?(lhansen) → review+
Comment 9•15 years ago
|
||
Resolved fixed engineering / work item that has been pushed. Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•