Changeset 14500 for docs/Perl6/Spec
- Timestamp:
- 10/24/06 17:23:47 (2 years ago)
- svk:copy_cache_prev:
- 21659
- Files:
-
- 1 modified
-
docs/Perl6/Spec/Concurrency.pod (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/Perl6/Spec/Concurrency.pod
r14499 r14500 88 88 Differently from any current concurrent process implementation in Perl, there 89 89 are no user accessible locks. Instead, the concept of Software 90 Transactiona bleMemory is used. This is in concept similar to the use of90 Transactional Memory is used. This is in concept similar to the use of 91 91 92 92 BEGIN TRANSACTION … … 174 174 175 175 Because Perl 6 must be able to revert its state to the state it had at the 176 checkpoint, it is not allowed to perform any non-revert able actions. These176 checkpoint, it is not allowed to perform any non-revertible actions. These 177 177 would include reading / writing from file handles that do not support 178 178 C<seek> (such as sockets). Attempting to do so will cause a fatal error … … 185 185 186 186 If you're not interested in revertability, but are interested in 187 uninter uptability, you could use the "is critical" trait.187 uninterruptability, you could use the "is critical" trait. 188 188 189 189 =head2 Critical Code blocks … … 264 264 CORE::GLOBAL::exit; # kills all the threads 265 265 266 # We intent entionally do not list cross-machine parallelism Conc:: classes here.266 # We intentionally do not list cross-machine parallelism Conc:: classes here. 267 267 # Consult your local 6PAN mirror with a time machine. 268 268 use Conc::Processes; # fork() or createProcess based implementation … … 299 299 - .started # time 300 300 - .finished # time 301 - .waiting # suspen ed (not diff from block on wakeup signal)301 - .waiting # suspended (not diff from block on wakeup signal) 302 302 # waiting on a handle, a condition, a lock, et cetera 303 303 # otherwise returns false for running threads … … 308 308 - "is throttled" trait 309 309 310 method throttled::trait_auxil lary:<is> ($limit=1, :$key=gensym()) {310 method throttled::trait_auxiliary:<is> ($limit=1, :$key=gensym()) { 311 311 # "is throttled" limits max connection to this Code object 312 312 # the throttling is shared among closures with the same key … … 314 314 # if the counter with the "key" equals or exceeds a closure's limit, 315 315 # the closure can't be entered until it's released 316 # (this can be trivially impl mented using contend+defer)316 # (this can be trivially implemented using contend+defer) 317 317 } 318 318 … … 364 364 # it's run once during initial compilation under the 365 365 # Separate Compilation doctrine and the syms sealed off 366 # to form part fobytecode syms headers366 # to form part of bytecode syms headers 367 367 %CALLER::<&blah> = { 1 }; # work - adds to export set 368 368 die "Eureka!" if %CALLER::<$sym>; # never dies … … 446 446 If you request a repeated alarm using the C<repeated> named argument, it will 447 447 attempt to fire off the alarm that many times. However, the alarm will be 448 sup ressed when inside a C<CATCH> block that's already handling the exception448 suppressed when inside a C<CATCH> block that's already handling the exception 449 449 raised by I<same> alarm. 450 450 … … 503 503 } 504 504 } 505 } # implicit falloff return + return() means start over without yielding505 } # implicit falloff return + return() means start over without yielding 506 506 # return() means yielding and restart + no implicit falloff (I LIKE THIS) 507 507
