Hiren Patel <[EMAIL PROTECTED]> writes:

> I am currently going through the design documents provided on
> Ptolemy's website and I understand that the determination of whether
> the threading model is preemptive or cooperative is up to the
> implementers of the virtual machine and can vary across different
> implementations. As a result, Java developers must write programs
> that work under both models.
> 
> My questions:
> 
> 1. Does Ptolemy's actors, directors etc. (ProcessThread classes)
> accomodate both cooperative and preemptive thread models to allow
> for platform-independence?

Yes, Ptolemy's code accomodates both cooperative and preemptive thread
models by design.  We run the test suite under both Solaris and
Windows, which have different native threading models.  Ptolemy
domains are usually deterministic even when run on different
platforms.

The fact that scheduling is platform dependent under Java is (IMHO)
one of Java's failings.  So much for write once, run everywhere.

> 2. What special considerations are given to the threads in Ptolemy
> (as briefly described on page 50 of the Actor package on the design
> documents)?

I'm not sure I understand the question?

ptolemy.actor.Manager uses
ptolemy.kernel.util.PtolemyThread

ptolemy.actor.process.ProcessThread uses
 ptolemy.kernel.util.PtolemyThread

ptolemy.actor.process.ProcessDirector uses
ptolemy.actor.process.ProcessThread 

ptolemy.actor.process.CompositeProcessDirector extends
ptolemy.actor.process.ProcessThread 

CSPDirector, DDEDirector and PNDirector all extend
ptolemy.actor.process.CompositeProcessDirector.java

You could check out those classes to see how its done.

> 3. Are there better documents that describe this other than the
> Actor package and the source code itself?

The source code is the ultimate reference.
There are also the following papers
Mudit Goel, "Process Networks in Ptolemy II"
Technical Memorandum UCB/ERL M98/69
Electronics Research Laboratory, Berkeley, CA 94720 December 16, 1998 
http://ptolemy.eecs.berkeley.edu/publications/papers/98/PNinPtolemyII/

Neil Smyth, "Communicating Sequential Processes in Ptolemy II"
Technical Memorandum UCB/ERL M98/70
Electronics Research Laboratory, Berkeley, CA 94720 December 15, 1998 
http://ptolemy.eecs.berkeley.edu/publications/papers/98/CSPinPtolemyII/

_Christopher

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to