Re: SVG 1.2 Raw Socket impl. in JavaScript

Hello,
 
> The problem with it is that you really need
> multithreading to do sync reads 
> without locking the UI. ECMAScript lacks it and Java
> has its own socket 
> APIs already.

I am aware of that, but is that realy a problem?
Sure, the Socket has to run in a seperate thread and 
the script needs an object to maybe even wait on or
would have to go into a waiting loop until there is
data available to read if it wishes to do so.
It will involve thread synchronization, is that the
problem?

Doesn't the impl. for async operation use multiple
threads too? At least one that runs in the background
and when data comes in an event is generated and that
event is put into the script's execution queue. The
script object for the event is then run when all other
script objects in the queue before it have finished.
I see this for the timer objects, too.
That's just a guess, though. 
Maybe everything just runs in one single thread.
And any js execution would block everything else.
For the things like event's that will have to run
inside the script I would understand the blocking
because they just could not run whenever some other
script code runs. But I don't think the application
executing the script needs to block, all it needs to
do is to add script objects to a waiting queue and go
on with it's on business.

How do animations work? They run in a seperate thread,
don't they? I can have my animation running and a long
loop in JS at the same time. And if the animation
should fire an event then it is nicely appended to the
executen of the script. Once my loop is done and there
is nothing else to execute the event is dispatched and
the script for the event is run.
 
Maybe I am completely missing something?

I have worked with the Rhino JS engine in Java(the C
impl. Seamonkey is what ASV uses, right?).
My application had multiple threads one of them was
script execution. It ran insided an applet.
Objects inside the script could be accessed from
within the webpage(SVG) through the applet and the
script environment would also fire events which called
objects inside the webpage...
With Rhino it is even possible to create threads in
JavaScript, just try the rhino interactive JS shell.
I did use this in my app, too. 
If Batik would fix the problem with impl. interfaces
in JS then one could even use this in SVG as one can
in Rhino. 

I just don't see multythreading as a problem.

Jan






__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

Received on Wednesday, 17 March 2004 04:36:13 UTC