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 16328 - Make module system change firing synchronous
Summary: Make module system change firing synchronous
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on: 13352 16329
Blocks: 15477 26064
  Show dependency tree
 
Reported: 2001-10-08 11:36 UTC by Jesse Glick
Modified: 2008-12-23 08:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-10-08 11:36:31 UTC
During module reload, all of which happens inside the write mutex, PROP_ENABLED
is fired first to false then to true (when the mutex is exited). This is not
quite correct since when the mutex is entered and exited, this property has the
same value, so technically no change should be fired. Generally ChangeFirer
should account for the situation where more than one change within a given write
mutex is posted for the same source and property: only one change should be
fired; its old value should be taken from the first posted one; its new from the
last; and if it is the case that for any pair of adjacent changes posted, the
old and new values are both non-null and different, this is an illegal state;
and if the old and new values of the single change would thus be non-null and
equal, no change at all should be fired.

Also Yarda says that ChangeFirer should not need to be a separate thread, you
can post a read mutex request and it will run immediately after the write mutex
is exited, which would be more predictable.
Comment 1 Jesse Glick 2001-11-06 11:34:08 UTC
I am not sure if this is actually a valuable goal.... it seems many
more people are relying on module change firing than was a design goal
for it (it was intended as a very marginal feature for obscure display
purposes, perhaps). Perhaps it should be synchronous, with the write
mutex held but only read operations permitted. This would simplify a
lot of code and tests too. Basically, there would be a global "firing"
flag; mutating methods would first check that it was off, and that the
method is inside a write mutex, then do their thing, then turn it on,
fire changes, then turn it off. This would make the synchronization
very safe and the timing more predictable. What do you think? (Depends
on a feature in mutex...) Not for 3.3 but for later.
Comment 2 Jaroslav Tulach 2001-11-06 14:19:50 UTC
The requested change in mutex has been implemented, I guess. Otherwise
I managed to solve the firing issue, I do not need it anymore.
Comment 3 Jesse Glick 2001-11-06 14:58:36 UTC
#13352 is what I was referring to.
Comment 4 Marek Grummich 2002-07-22 08:33:23 UTC
Target milestone was changed from '3.4' to TBD.
Comment 5 Marek Grummich 2002-07-22 08:44:34 UTC
Target milestone was changed from '3.4' to TBD.
Comment 6 Marek Grummich 2002-07-22 08:44:58 UTC
Target milestone was changed from '3.4' to TBD.
Comment 7 Marek Grummich 2002-07-22 08:49:32 UTC
Target milestone was changed from '3.4' to TBD.
Comment 8 Jesse Glick 2002-08-24 05:36:22 UTC
I have a patch which causes all module system changes to be fired
synchronously at the end of the mutator method. Though you are inside
a write mutex, you are prevented from making any mutations within the
scope of the change callbacks. This is very simple and predictable as
threading things go, and should be intuitive for users of the
JavaBeans spec which requires something very similar.
Comment 9 Jesse Glick 2002-08-24 06:46:47 UTC
ChangeFirer.java 1.5
Module.java 1.32
ModuleManager.java 1.39

Note that ModuleManagerTest still uses a timeout-based PCL when
testing whether changes are fired. In fact the timeout could probably
now be deleted if desired.
Comment 10 Marian Mirilovic 2005-07-13 13:20:15 UTC
closed