.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Thread::Tie::Thread 3pm" .TH Thread::Tie::Thread 3pm "2019-11-16" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Thread::Tie::Thread \- create threads for tied variables .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Thread::Tie; # use as early as possible for maximum memory savings \& \& my $tiethread = Thread::Tie::Thread\->new; \& tie stuff, \*(AqThread::Tie\*(Aq, {thread => $thread}; \& \& my $tid = $tiethread\->tid; # thread id of tied thread \& my $thread = $tiethread\->thread; # actual "threads" thread \& $tiethread\->shutdown; # shut down specific thread .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .Vb 1 \& *** 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. \& \& ************************* .Ve .PP The Thread::Tie::Thread module is a helper class for the Thread::Tie module. It is used to create the thread in which the actual code, to which variables are tied with the Thread::Tie class, is located. .PP Please see the documentation of the Thread::Tie module for more information. .SH "CLASS METHODS" .IX Header "CLASS METHODS" There is only one class method. .SS "new" .IX Subsection "new" .Vb 1 \& my $tiethread = Thread::Tie::Thread\->new; .Ve .PP The \*(L"new\*(R" class method returns an instantiated object that can be specified with the \*(L"thread\*(R" field when \fBtie()\fRing a variable. .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" The following object methods are available for the instantiated Thread::Tie::Thread object. .SS "tid" .IX Subsection "tid" .Vb 1 \& my $tid = $tiethread\->tid; .Ve .PP The \*(L"tid\*(R" object method returns the thread id of the actual threads thread that is being used. .SS "thread" .IX Subsection "thread" .Vb 1 \& my $thread = $tiethread\->thread; .Ve .PP The \*(L"thread\*(R" object method returns the actual threads thread object that is being used. .SH "OPTIMIZATIONS" .IX Header "OPTIMIZATIONS" This module uses AutoLoader to reduce memory and \s-1CPU\s0 usage. This causes subroutines only to be compiled in a thread when they are actually needed at the expense of more \s-1CPU\s0 when they need to be compiled. Simple benchmarks however revealed that the overhead of the compiling single routines is not much more (and sometimes a lot less) than the overhead of cloning a Perl interpreter with a lot of subroutines pre-loaded. .SH "AUTHOR" .IX Header "AUTHOR" Elizabeth Mattijsen, . .PP Please report bugs to . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2002\-2003 Elizabeth Mattijsen . All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Thread::Tie, threads, AutoLoader.