Re: Are Perl6 threads preemptive or cooperative?

2000-08-28 Thread Dan Sugalski

At 12:11 PM 8/28/00 -0500, David L. Nicol wrote:

What if every subroutine tagged itself with a list of the globals
it uses, so a calling routine would know to add those to the list
of globals it wants locked?

If you're looking for automagic locking of variables, you're treading deep 
into "Interesting Research Problem" territory (read: Solve the Halting 
Problem and win a prize!) if you want it to not deadlock all over the place.

Been there. Tried that. Backed away *real* slowly... :)

Dan

--"it's like this"---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk




Re: Are Perl6 threads preemptive or cooperative?

2000-08-27 Thread Steven W McDougall

 That a user my need to have two or more variables in sync for proper
 operation. And cooperative threads don't address that issue.

 Cooperative only helps _perhaps_ with perl not needing to protrect its
 own structures.

We are in agreement.

I was specifically addressing the problem of protecting internal
interpreter data structures, and specifically ignoring the problem of
synchronizing user access to data.


- SWM



Re: Are Perl6 threads preemptive or cooperative?

2000-08-25 Thread Markus Peter

--On 25.08.2000 20:02 Uhr -0400 Steven W McDougall wrote:

 Others have pointed out that code inside sub-expressions and blocks
 could also assign to our variables. This is true, but it isn't our
 problem. As long as each assignment is carried out correctly by the
 interpreter, then each variable always has a valid value, computed
 from other valid values.

Depends on who 'our' is, if you're an internals guy you need not care, 
that's true, but as a user of the language you care about how much sync-ing 
you have to do yourself in your perl code - the preemptive vs. cooperative 
discussion is there valid as well though it would probably be good to 
seperate these discussions :-)

-- 
Markus Peter - SPiN GmbH
[EMAIL PROTECTED]