Elizabeth Mattijsen > Thread-Synchronized-0.03 > Thread::Synchronized

Download:
Thread-Synchronized-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Thread::Synchronized - synchronize subroutine calls between threads

SYNOPSIS ^

    use Thread::Synchronized;  # activate synchronized and method attribute

    sub foo : synchronized { } # only one subroutine running at a time

    sub bar : synchronized method { } # only one method per object

DESCRIPTION ^

                  *** A note of CAUTION ***

 This module only functions on Perl versions 5.8.0 and later.
 And then only when threads are enabled with -Dusethreads.  It
 is of no use with any version of Perl before 5.8.0 or without
 threads enabled.

                  *************************

This module currently adds one feature to threaded programs: the "synchronized" and "method" subroutine attributes which causes calls to that subroutine to be automatically synchronized between threads (only one thread can execute that subroutine at a time or per object at a time).

REQUIRED MODULES ^

 (none)

CAVEATS ^

This module is implemented using a source filter. This has the advantage of not needing to incur any runtime overhead. But this of course happens at the expense of a slightly longer compile time.

AUTHOR ^

Elizabeth Mattijsen, <liz@dijkmat.nl>.

Please report bugs to <perlbugs@dijkmat.nl>.

COPYRIGHT ^

Copyright (c) 2003 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

threads.

syntax highlighting: