swarm-support
[Top][All Lists]
Advanced

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

RE: Is the Swarm Scheduler Thread safe?


From: Tee Toth-Fejel
Subject: RE: Is the Swarm Scheduler Thread safe?
Date: Thu, 28 Sep 2000 16:27:20 -0400

> TTF> Does anyone know if Schedule is thread-safe, or how I could find
> TTF> out if it was? 
> 
> No general effort has been made to make Swarm thread safe.
> If you, say, have a Java widget running in another thread 
> that wants to tell
> Swarm to do something, you should queue those events up in a list, and
> let Swarm consume them.

Thanks for such a quick and definitive answer.
When you say "queue those events in a list", I assume you mean put them on
the event scheduler something like this:

      Selector doSomethingSel= new Selector (getClass(), "doSomething",
false);
      schedule.at$createActionTo$message (1, this, doSomethingSel);

But how do you get doSomething to pay attention to the outside world?  - not
just a different thread, but another process or another machine.

Would you do something like:
   public void doSomething(InetAddress inetAddress, int port) 
        {
        Socket client = new Socket(inetAddress, port); 
        InputStream = client.getInputStream();
        int ch = in.read();
        ...

Thanks again!

Tihamer "Tee" Toth-Fejel                    Member of Technical Staff
(734) 623-2544   address@hidden      http://www.anteaters.net/ttf/  
Center for Electronic Commerce, Environmental Research Institute of Michigan


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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