[plt-scheme] Q. about editor<%> internal-locks

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Oct 7 16:06:12 EDT 2009

On Wed, Oct 7, 2009 at 2:58 PM, John Clements <clements at brinckerhoff.org> wrote:
> On Oct 7, 2009, at 12:31 PM, Robby Findler wrote:
>> Are you accessing the editor from more than one thread?
> No.  In particular, the only references to this editor are
> 1) it's embedded in a canvas which is part of a visible pane, and
> 2) There's an "update" method that is called by only one thread.
> Also, in order to verify this, I protected it with a semaphore (which had no
> effect) and bracketed it with printfs (which confirmed that there were
> always an equal number of 'enter's and 'exit's before an 'enter'). My guess
> is therefore that the internal locking is caused by some kind of
> drawing-to-the-screen-mumble process that I have no control over.

It is possible that there is some refresh being queued and things are
locked until that refresh completes. Which is strange, but would be
one possible explanation of why sleep/yield polling works.

I don't suppose you can make this happen in a small(ish) program so we
can see what's going on?

Maybe Matthew has some idea or already knows what is going on, tho, so
it might be best to wait for him to ring in before spending too much
time trying to narrow things down.

Sorry I'm not much use after all.


Posted on the users mailing list.