Changeset 19851 for docs/Perl6/Spec

Show
Ignore:
Timestamp:
02/08/08 22:18:37 (10 months ago)
Author:
buchetc
Message:

Some new heads and code formats

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/Concurrency.pod

    r14500 r19851  
    1414 Maintainer: Elizabeth Mattijsen <liz@dijkmat.nl> 
    1515 Date: 13 Jun 2005 
    16  Last Modified: 13 Nov 2005 
     16 Last Modified: 08 Feb 2008 
    1717 Number: 0 
    18  Version: 1 
     18 Version: 2 
    1919 
    2020=head1 SKETCH 
     
    259259the use of named parameters is therefore advisable. 
    260260 
    261 ####################################################################### 
    262 Below here still the more or less unorganized stuff 
    263  
    264 CORE::GLOBAL::exit; # kills all the threads 
    265  
    266 # We intentionally do not list cross-machine parallelism Conc:: classes here. 
    267 # Consult your local 6PAN mirror with a time machine. 
    268 use Conc::Processes; # fork() or createProcess based implementation 
    269 use Conc::Threads;   # maybe it just exports &async to override the default one, yay 
    270 use Conc::Multiplex; # this is default 
    271  
    272 my $thr = async { 
    273     ...do something... 
    274     END { } 
    275 }; 
    276  
    277 Conc::Thread.this 
    278 Conc::Proc.this 
     261=head2 Threads 
     262 
     263 
     264=head3 Kill all 
     265 
     266   CORE::GLOBAL::exit; # kills all the threads 
     267 
     268 
     269=head3 Thread models  
     270 
     271We intentionally do not list cross-machine parallelism Conc:: classes here. 
     272Consult your local 6PAN mirror with a time machine. 
     273 
     274   use Conc::Processes; # fork() or createProcess based implementation 
     275   use Conc::Threads;   # maybe it just exports &async to override the default one, yay 
     276   use Conc::Multiplex; # this is default 
     277 
     278   my $thr = async { 
     279       ...do something... 
     280       END { } 
     281   }; 
     282 
     283   Conc::Thread.this 
     284   Conc::Proc.this 
     285 
     286=head3 Thread methods and attributes 
    279287 
    280288Conc object # name is still up for grabs! 
    281 - numify to TIDs (as in pugs) 
    282 - stringify to something sensible (eg. "<Conc:tid=5>"); 
    283 - enumerable with Conc.list 
    284 - Conc.yield (if this is to live but deprecated, maybe call it sleep(0)?) 
    285 - sleep() always respects other threads, thank you very much 
    286 - standard methods: 
     289 
     290 - numify to TIDs (as in pugs) 
     291 - stringify to something sensible (eg. "<Conc:tid=5>"); 
     292 - enumerable with Conc.list 
     293 - Conc.yield (if this is to live but deprecated, maybe call it sleep(0)?) 
     294 - sleep() always respects other threads, thank you very much 
     295 - standard methods: 
    287296    - .join    # wait for invocant to finish (always item cxt) 
    288297    - .die     # throw exception in the invocant thread 
     
    296305               # including wait (which will always return undef) 
    297306               # also needs to discard any atomicity context 
    298 - attributes: 
     307 - attributes: 
    299308    - .started  # time 
    300309    - .finished # time 
     
    306315                # the CC currently running in that thread 
    307316 
    308 - "is throttled" trait 
     317 - "is throttled" trait 
    309318 
    310319    method throttled::trait_auxiliary:<is> ($limit=1, :$key=gensym()) { 
     
    325334    async { $f.b } 
    326335 
    327 - Thread::Status 
     336 
     337=head3 Thread status 
     338 
    328339- IO objects and containers gets concurrency love! 
    329340    - $obj.wake_on_readable 
     
    343354# unjoined threads will be joined at the beginning of the END block batch 
    344355# of the parent thread that spawned them 
     356 
     357 
     358=head2 Still more or less unorganized stuff 
     359 
    345360 
    346361### INTERFACE BARRIER ###