[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [Subclipse-dev] Syncinfo core rewritten

From: Martin Letenay <mle_at_whitestein.com>
Date: 2005-07-08 09:20:27 CEST

> >
> > I will keep testing. Just wanted to provide some early
> feedback. For
> the
> > most part, it all seems to be working OK. However, I
> experience the
> > deadlock everytime when I have an incoming file add and I
> do an update.
> I
> > get the progress dialog up and it show Building Workspace and Team
> > Sync Operation. If I cancel the latter I am back in
> business. I do
> > not see this on updates or deletes.
> fyi .. the problem is much worse when doing an update
> involving the add of a folder and file within the folder. In
> that case, Eclipse hangs and there is nothing I can cancel.
> I had to kill it.
> Mark

These multithreaded things are really fun to debug.
Smells like quantum physics - just observing it changes its behaviour ...
(Like when I put some debug trace to stdout, the threads tend to synchronize
and no deadlocks appear ...)

Anyway, the synchronized/deadlock problem seems to be caused by the
SyncInfoSynchronizedAccessor#internalSetCachedSyncBytes method.
It's calling a long running Synchronizer#setSyncInfo and then ...
I think I was bit too paranoid putting the synchronized keyword there.
Only methods which are accessing
SyncInfoSynchronizedAccessor#pendingCacheWrites map should be synchronized.

So if you'll remove the synchronize keywords from internalSetCachedSyncBytes
and internalGetCachedSyncBytes of SyncInfoSynchronizedAccessor,
the deadlocks should not occur anymore ...

Received on Fri Jul 8 17:20:27 2005

This is an archived mail posted to the Subclipse Dev mailing list.