|
From: | John Swensen |
Subject: | Re: Proposed patch for threadsafe access to octave internal data |
Date: | Mon, 16 Jul 2007 07:50:29 -0400 |
User-agent: | Thunderbird 2.0a1 (X11/20060807) |
John Swensen wrote:
This patch doesn't necessarily need to go into the octave source tree. After I fix up the gnu_readline class to allow multiple people to register with the readline event hook, I can just leave this server class in my own package and register it with octave when I run my IDE. I just imagined that others working on an IDE might need to do the same thing and it would then make sense to incorporate it into the main tree of octave.Michael Goffioul wrote: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.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 Ihave created a class called octave_server that has a mutex protected setof data and acts as an intermediary between my IDE and octave. I have registered a function with the octave_rl_event_hook so that whenreadline is idle, a function is called that processes data sent from theIDE to octave (e.g. requests for variables values, breakpoint operations, etc) and then fills in buffers for data that is updatedregularly (e.g. the names and properties of variables that are currentlyin 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.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
John Swensen
[Prev in Thread] | Current Thread | [Next in Thread] |