Tcl and Scilab Event loop
Bruno JOFRET
bruno.jofret at inria.fr
Fri Jan 11 11:07:40 CET 2008
Hi all puffin friends !
First of all, I wish all of you my best wishes for 2008 : health and
happiness !
And obviously a great success for Scilab 5 and beyond.
I'm now working on the Tcl running in Scilab and the "Scilab Event Loop".
I confess with the new Java GUI, TCL based stuff were muddy.
Some answers on that issue :
- Tcl based GUI needs manually "update" in order to live.
Of course because Tcl is a scripting language.
- Scilab was strongly single threaded and running in an endless loop
(that's why it was able to update Tcl/Tk periodically)
Now with the Java gui the "update" loop was slowed down (not so often
called).
This explain why it looks so muddy.
The main idea of my work was to unlink scilab internal behaviour and Tcl
management.
For that issue I created the TCL Interpreter used in Scilab in it's
single thread.
It works as follow :
* I created a timer thread within this one
* WHILE Tcl is started
IF we have a TCL command to execute
runIt
ELSE
Do "update"
Wait until we receive a "wake up" signal
ENDIF
ENDWHILE
The timer thread is quite dummy.
It only send periodically a "wake up" signal.
"Wake up" signal are also send when asking for a TCL command through Scilab.
A call to Tcl_EvalStr for instance.
It works pretty well on my computer but has some restrictions.
- I used pthread that is not supported on Windows.
But we are working to native similar thread management on Windows.
- Some others commands may be broken.
Some improvements are quite cool :
- You can now run some huge stuff in Scilab, and continue to write in
Scipad.
- No more muddy help browser.
- Whole Scilab behaviour is decreasing computation power need.
Keeping in mind I absolutely do not want to break any OS Scilab version,
neither any Scilab Tool (Scipad, ged, ...) ,
- What do you think of that "algorithm" and did you see any hidden
drawbacks within it ?
- As soon as we will have Windows similar functionalities, and taking
into account your comments,
we will include this into the Trunk and kindly ask you for some feedbacks.
Regards,
--
Bruno JOFRET
Project Engineer
___SCILAB - INRIA Rocquencourt___
Domaine de Voluceau - B.P. 105
78153 Le Chesnay Cedex
Tel : (+33/0)1.39.63.58.63
Mailto : bruno.jofret at inria.fr
http://www.scilab.org
More information about the dev
mailing list