[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: newbiew qn: how to add a viewer to the EMF editor plugin

Charles,

I terms of transactions, a write lock is exclusive and no other thread may read or write while it's held. Even a read lock is exclusive, but the holder can voluntarily yield to allow another reader access during a long running operation.


Charles Martin wrote:
> Charles,

> Somehow I think holding a write lock for minutes will
> not be a good > thing. The UI would not be able to even read the
> model for this whole > period of time so had better not even try. That's
> why my sense is that > something that takes five minutes should produce no
> visible changes > until it's done. Let the UI view an old plot until
> there is a new one > and then switch it when its done.
> Yes, I am planning to simply change the background color of the plot to a light red or something so the user knows it is out of sync. So I need to send a message to the view indicating that a change has occur. Likewise, when the plot is being calculated, I need a way signal the editor to disable all editing capacity (but still allow viewing).


I am little confused by your comment through--I want the plot to hold a "write" lock--I would expect the GUI could still "read" the model and display features of it.

I assume a simple mutex lock would work for this. Still, i would like to know how much of the framework I can leverage now.

  I did not think to look on the command stack to see what is pending, but that is a great idea, thanks.

Charles