Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Too much too many

[...]

> However, your message, above, also discusses permitting listeners to be
> notified on threads other than the UI thread, and this I strongly
> disagree with. Doing all your notifications on the UI thread is cheap as
> long as the listeners never do anything expensive synchronously, and
> they never need to. If a listener needs to do anything nontrivial, it
> can just mark something as dirty and initiate a job that does the
> expensive part. By allowing multithreaded notifications, you'd need to
> protect all the observable data and listener lists with mutexes or
> synchronized blocks, which are SLOW and destroy your cache utilization.

I didn't want to say that sending asynchronous-Events does not make
sense at all - there might be situations they make sense.

What I wanted to express was that (in the current setup) it makes
nosense at all to use IEventBroker#post() because in the end all what
happens is

1     Event is posted
1 - n Subscribers run code like this on their own

      Event evt = ...;
      Display.runAsyncExec( () -> process(evt) );

So posting 1 Event with with 10 subscribers leads to 10 scheduled
runnables on the event-queue.

I agree with you that we should have a central place where we collect
what we want to recalculate in the next EventLoop-Pass (this is how
SceneGraph-Toolkits like JavaFX work) and remove duplicate calculations
there, ... .

On the other hand we should try that we don't invalidate too much parts
(eg closing a window invalidates the complete IEclipseContext hierarchy!).

I'll cleanup the patch (I'll remove the synchronization stuff who just
can't happen, remove the parts who calculate the stats) and submit that
for review. I'd really like to this patch getting merged for M7 ASAP so
that we can see if that leads to any regressions.

Tom

-- 
Thomas Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7, A-6020 Innsbruck
http://www.bestsolution.at/
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck


Back to the top