This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 123832 - Pluggable Mutex wrapping API to prevent common deadlocks
Summary: Pluggable Mutex wrapping API to prevent common deadlocks
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST
Depends on: 123899
Blocks: 91291
  Show dependency tree
 
Reported: 2007-12-11 16:21 UTC by Jaroslav Tulach
Modified: 2008-12-22 11:51 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed API with a test, however without implementation (9.23 KB, patch)
2007-12-11 17:00 UTC, Jaroslav Tulach
Details | Diff
New API based on java.util.concurent.Executor (18.18 KB, patch)
2007-12-11 21:40 UTC, Jaroslav Tulach
Details | Diff
Sample usage of this API in projects to prevent most common deadlocks (6.34 KB, patch)
2007-12-11 21:41 UTC, Jaroslav Tulach
Details | Diff
Imporved patch that makes sure that only first entrace to the mutex invokes the Executor (18.30 KB, patch)
2008-01-02 12:50 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2007-12-11 16:21:22 UTC
A lot of deadlocks is caused by ProjectManager.MUTEX and its habit of doing filesystem operations and refiring them 
while the MUTEX is still in read or write state. This could be avoided if all ProjectManager operations first invoked 
masterfs.runAtomicAction( { MUTEX.xyzAccess( { ... } ) ). This is hard to enforce, as the MUTEX is part of public API 
and everyone can calls its methods. That is why I suggest an API that would allow the creator of a Mutex to wrap these 
calls by custom pre and post code executed outside of the mutex locks.
Comment 1 Jaroslav Tulach 2007-12-11 17:00:22 UTC
Created attachment 54156 [details]
Proposed API with a test, however without implementation
Comment 2 Jaroslav Tulach 2007-12-11 17:05:14 UTC
This API should solve the deadlocks seen after last integration of issue 91291.
Comment 3 Jaroslav Tulach 2007-12-11 21:40:47 UTC
Created attachment 54167 [details]
New API based on java.util.concurent.Executor
Comment 4 Jaroslav Tulach 2007-12-11 21:41:51 UTC
Created attachment 54168 [details]
Sample usage of this API in projects to prevent most common deadlocks
Comment 5 Jaroslav Tulach 2007-12-11 21:43:43 UTC
I believe that this issue, together with issue 91291 can improve UI responsivness of project customizers. Please check 
the API and proposed impls.
Comment 6 Jesse Glick 2007-12-11 22:50:47 UTC
Typo in apichanges: "priviledged"
Comment 7 Jaroslav Tulach 2008-01-02 12:50:29 UTC
Created attachment 54593 [details]
Imporved patch that makes sure that only first entrace to the mutex invokes the Executor
Comment 8 Jaroslav Tulach 2008-01-02 12:51:16 UTC
Unless somebody objects, I'll integrate tomorrow.