octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed patch for threadsafe access to octave internal data


From: John Swensen
Subject: Re: Proposed patch for threadsafe access to octave internal data
Date: Mon, 16 Jul 2007 06:31:32 -0400
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)

Michael Goffioul wrote:
On 7/15/07, John Swensen <address@hidden> wrote:
I have attached my first shot at a patch to allow the IDE I am writing
threadsafe access to octave internal data.  The basic idea is that I
have created a class called octave_server that has a mutex protected set
of data and acts as an intermediary between my IDE and octave.  I have
registered a function with the octave_rl_event_hook so that when
readline is idle, a function is called that processes data sent from the
IDE to octave (e.g. requests for variables values, breakpoint
operations, etc) and then fills in buffers for data that is updated
regularly (e.g. the names and properties of variables that are currently
in scope, new lines of history information, etc.) for subsequent
asynchronous access by the IDE.  According to the readline
documentation, the event hook is called at most 10 times per second.
This is more than adequate for the needs of the IDE.

What if some other code wants to install its own input event hook?
(octplot or jhandles does it). Are they correctly chained?

Michael.

No, it does not. That will require a change to the gnu_readline class, so that multiple packages can register for the rl_event_hook and then it dispatches them (in the order they are registered). At the current time, though I suppose it doesn't make much sense, octplot and jhandles could not coexist either. That is, unless you are handling setting up more than one event hook in a different manner.

This isn't a very big change, so I will try to have another patch for this done by the end of today.

John Swensen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]