Re: RFC 178 (v1) Lightweight Threads

[email protected] (Chaim Frenkel) 01 Sep 2000 14:45:07 -0400
Newsgroups perl.perl6.language.flow
Message-ID <[email protected]>
>>>>> "KF" == Ken Fox <[email protected]> writes:

KF> The more interesting case is this:

KF>     #!/my/path/to/perl
KF>     sub foo_generator { my $a = shift; sub { print $a++ } }
KF>     my $foo = foo_generator(1);
KF>     $foo->();
Thread-> new($foo);

KF> Is $a shared between threads or not? If $a is not shared, we've broken
KF> lexicals.

Not unless it is so declared	my $a :shared.

What the value is without the attribute, I won't even think about.
Are we going the fork() route where the current value is cloned, or perhaps
something else entriely.

Would making closures only under direct instructions be something useful?

It would add some typing, but would be a guide to both the reader and
perl (and perhaps, prevent some unanticipated closures from being created.)

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
[email protected]				               +1-718-236-0183