Data sharing using COROUTINE? 
Author Message
 Data sharing using COROUTINE?

Quote:

> Garbage collection is also required to fully implement the ISO standard
> for Object Oriented Modula-2. The p1 compiler for the Mac has a fuull
> ISO implementation.

Is Object Oriented Modula-2 still using the old-fashioned SYSTEM.NEWPROCESS
primitive or do does it introduce a new operation that does not require
a stack space to be given?

Andreas.

--
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany

WWW:     http://www.*-*-*.com/



Mon, 01 Oct 2001 03:00:00 GMT  
 Data sharing using COROUTINE?

:   BEGIN (* Outside *)
:     (* 'n' now exists some stack - call this stack s1 *)
:     n := 0;
:     p := NewProcess(Inside);
:     (* 'p' gets its own local stack, initially empty - call it s2 *)
:     StartProcess(p);
:     ... etc ...
:    END Outside;
:    
: So: does each coroutine get its own local stack, or does it share the
: stack of the process which created it, or some hybrid?

What about giving the process Inside a copy of stack s1?

--
Linux99 - The choice of a gnu generation.



Tue, 02 Oct 2001 03:00:00 GMT  
 Data sharing using COROUTINE?

Quote:


> > Garbage collection is also required to fully implement the ISO standard
> > for Object Oriented Modula-2. The p1 compiler for the Mac has a fuull
> > ISO implementation.

> Is Object Oriented Modula-2 still using the old-fashioned SYSTEM.NEWPROCESS
> primitive or do does it introduce a new operation that does not require
> a stack space to be given?

> Andreas.

OOM-2 is described (in a rough draft) in the shareware text at
http://www.twu.ca/rsbook/Index.html

chapter 19

It is a set of additions to the base language standard, which has not
itself been changed for this purpose.

COROUTINES.NEWCOROUTINE still takes a workspace parameter.

Rick

--
Rick Sutcliffe
Trinity Western University (Not speaking officially)



Tue, 02 Oct 2001 03:00:00 GMT  
 Data sharing using COROUTINE?
G'day,

Quote:


> :   BEGIN (* Outside *)
> :     (* 'n' now exists some stack - call this stack s1 *)
> :     n := 0;
> :     p := NewProcess(Inside);
> :     (* 'p' gets its own local stack, initially empty - call it s2 *)
> :     StartProcess(p);
> :     ... etc ...
> :    END Outside;
> :
> : So: does each coroutine get its own local stack, or does it share the
> : stack of the process which created it, or some hybrid?

> What about giving the process Inside a copy of stack s1?

The problem is: does the process receive a *copy* of the stack s1, such
that changes to variables (such as 'n') declared within the stack s1 are
not visible to the stack s2 of the 'Inside' process, or should such
changes be propogated (ie, all processes have access to data of the
parent process)? For consistency with coroutines having access to the
global storage area, the latter option should be chosen.

I'm investigating a way of doing this (using static links and retaining
popped stack frames until any processes which rely on them have
terminated), but need to check the correctness of it first. It may well
be impossible. Examples/counter examples welcome.

Cheers,
Geoff



Fri, 05 Oct 2001 03:00:00 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software