view release on metacpan or search on metacpan
0.02 Thu Apr 12 10:40:48 CEST 2007
- mildly hacked version
0.03 Mon Apr 16 09:32:07 CEST 2007
- added threaded stuff
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ArrayData/Lingua/Word/EN/Enable.pm view on Meta::CPAN
packs
packsack
packsacks
packsaddle
packsaddles
packthread
packthreads
packwax
packwaxes
paclitaxel
paclitaxels
pacs
lib/ArrayData/Lingua/Word/EN/Enable.pm view on Meta::CPAN
rethinker
rethinkers
rethinking
rethinks
rethought
rethread
rethreaded
rethreading
rethreads
retia
retial
retiarii
retiarius
retiary
lib/ArrayData/Lingua/Word/EN/Enable.pm view on Meta::CPAN
thrawed
thrawing
thrawn
thrawnly
thraws
thread
threadbare
threadbareness
threadbarenesses
threaded
threader
threaders
threadfin
threadfins
threadier
threadiest
threadiness
threadinesses
threading
threadless
threadlike
threads
threadworm
threadworms
thready
threap
threaped
threaper
threapers
threaping
lib/ArrayData/Lingua/Word/EN/Enable.pm view on Meta::CPAN
unthinkably
unthinking
unthinkingly
unthinks
unthought
unthread
unthreaded
unthreading
unthreads
unthreatening
unthrifty
unthrone
unthroned
unthrones
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ArrayData/Lingua/Word/EN/Medical/Glutanimate.pm view on Meta::CPAN
Thost
thought
thousandth
thozalinone
Thr
thread
threadworm
thready
Threamine
threat
three
threonine
threonyl
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ArrayData/Word/EN/Enable.pm view on Meta::CPAN
packs
packsack
packsacks
packsaddle
packsaddles
packthread
packthreads
packwax
packwaxes
paclitaxel
paclitaxels
pacs
lib/ArrayData/Word/EN/Enable.pm view on Meta::CPAN
rethinker
rethinkers
rethinking
rethinks
rethought
rethread
rethreaded
rethreading
rethreads
retia
retial
retiarii
retiarius
retiary
lib/ArrayData/Word/EN/Enable.pm view on Meta::CPAN
thrawed
thrawing
thrawn
thrawnly
thraws
thread
threadbare
threadbareness
threadbarenesses
threaded
threader
threaders
threadfin
threadfins
threadier
threadiest
threadiness
threadinesses
threading
threadless
threadlike
threads
threadworm
threadworms
thready
threap
threaped
threaper
threapers
threaping
lib/ArrayData/Word/EN/Enable.pm view on Meta::CPAN
unthinkably
unthinking
unthinkingly
unthinks
unthought
unthread
unthreaded
unthreading
unthreads
unthreatening
unthrifty
unthrone
unthroned
unthrones
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Arriba/Server.pm view on Meta::CPAN
'psgi.errors' => *STDERR,
'psgi.url_scheme' => $req->{scheme},
'psgi.nonblocking' => Plack::Util::FALSE,
'psgi.streaming' => Plack::Util::TRUE,
'psgi.run_once' => Plack::Util::FALSE,
'psgi.multithread' => Plack::Util::FALSE,
'psgi.multiprocess' => Plack::Util::TRUE,
'psgix.io' => $client,
'psgix.input.buffered' => Plack::Util::TRUE,
'psgix.harakiri' => Plack::Util::TRUE,
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Art/World/Util.pm view on Meta::CPAN
Also there is the Zydeco's C<$class> object.
This is a couple of utilities that makes a sort of meta-programming very simple. It is
more like a reminder for my bad memory than something very interesting. Largely
inspired by L<this Perl Monks thread|https://www.perlmonks.org/?node_id=1043195>.
Art::World::Meta->get_all_attributes( $artist );
# ==> ( 'id', 'name', 'reputation', 'artworks', 'collectors', 'collected', 'status' )
Mostly useless since Zydeco rely on Moo(se) so the Moose Meta Object Protocol is
view all matches for this distribution
view release on metacpan or search on metacpan
- New Module AMI::Common:Dev contains additional functions for working with Asterisk 1.6+
0.1.2 - All AMI Objects can now also be used a normal IO Handles. It is not recommended
that you read and write directly to them. This was added so you can add the AMI
object to something like IO::Select for single threaded server applications
- New module AMI::Common::Dev, which is currently empty. This will be where new functions
specific to Asterisk 1.6+ will go. When the next LTS of Asterisk is released these will then
be merged back into AMI::Common and new functions will be added here.
view all matches for this distribution
view release on metacpan or search on metacpan
use File::Spec;
use POSIX qw/sys_wait_h/;
use Errno qw/EAGAIN/;
use Carp;
use threads;
use threads::shared;
use Astro::Aladin::LowLevel;
'$Revision: 1.3 $ ' =~ /.*:\s(.*)\s\$/ && ($VERSION = $1);
# Check for threading
#use Config;
#print "Config: useithreads = " . $Config{'useithreads'} . "\n";
#print "Config: threads::shared loaded\n" if($threads::shared::threads_shared);
# A N O N Y M O U S S U B R O U T I N E S ---------------------------------
my $threaded_supercos_catalog = sub {
my ( $ra, $dec, $radius, $band, $file ) = @_;
# create a lowlevel object
my $aladin = new Astro::Aladin::LowLevel( );
share( $radius );
share( $band );
share( $file );
share( $status );
my $supercos_thread = threads->create( sub {
$status = &$threaded_supercos_catalog( $ra, $dec, $radius, $band, $file );
});
# wait for the supercos thread to join
$supercos_thread->join();
# return the status, with luck this will be set to $file, however
# if we get an error (and sucessfully pick up on it) it will be undef
return $status;
view all matches for this distribution
view release on metacpan or search on metacpan
Cosmology.pm view on Meta::CPAN
Most functions have two names; a short one and a (hopefully) more
descriptive one, such as C<pmot_dist()> and C<proper_motion_distance()>.
Most of the routines below include a C<sig:> line in their documentation.
This is an attempt to say how they
`L<thread|PDL::indexing>' (in the L<PDL|PDL> sense of the word).
So, for routines like C<lum_dist> - which have a sig line of
C<dl() = $cosmo-E<gt>lum_dist( z() )> - the return value has the
same format as the input C<$z> value; supply a scalar, get a scalar back,
send in a piddle and get a piddle of the same dimensions back.
For routines like C<abs_mag> - with a sig line of
C<absmag() = $cosmo-E<gt>abs_mag( appmag(), z() )> - you can thread over
either of the two input values,
in this case the apparent magnitude and redshift.
=head1 SUMMARY
Cosmology.pm view on Meta::CPAN
#
# note: we call the C code directly
#
sub lookback_time ($$;$) {
my $self = shift;
my $z_low = $#_ == 1 ? shift : 0; # let PDL do the threading if z_high is a piddle
my $z_high = shift;
return Astro::Cosmology::Internal::_lookback_time( $z_low, $z_high,
$self->{OMEGA_MATTER}, $self->{OMEGA_LAMBDA},
$self->{ABSTOL}, $self->{TCONV} );
view all matches for this distribution
view release on metacpan or search on metacpan
my @funcnts;
my @funhist;
BEGIN {
# use readdir instead of globs b/c of 5.6.0 multithreaded perl debug bug
opendir( DIR, "data" ) or die( "couldn't open data directory\n" );
my @files = grep { -f "data/$_" } readdir( DIR );
closedir( DIR );
@funcnts = grep { /^funcnts.*\.log$/ } @files;
view all matches for this distribution
view release on metacpan or search on metacpan
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
offer_nice_chunk|||
oopsAV|||
oopsHV|||
#endif
/* Hint: PL_ppaddr
* Calling an op via PL_ppaddr requires passing a context argument
* for threaded builds. Since the context argument is different for
* 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
* automatically be defined as the correct argument.
*/
#if (PERL_BCDVERSION <= 0x5005005)
#endif
/*
* Boilerplate macros for initializing and accessing interpreter-local
* data from C. All statics in extensions should be reworked to use
* this, if you want to make the extension thread-safe. See ext/re/re.xs
* for an example of the use of these macros.
*
* Code that uses these macros is responsible for the following:
* 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
* 2. Declare a typedef named my_cxt_t that is a structure that contains
defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
#ifndef START_MY_CXT
/* This must appear in all extensions that define a my_cxt_t structure,
* right after the definition (i.e. at file scope). The non-threads
* case below uses it to declare the data as static. */
#define START_MY_CXT
#if (PERL_BCDVERSION < 0x5004068)
/* Fetches the SV that keeps the per-interpreter data. */
#else
/* older perls don't have PL_numeric_radix_sv so the radix
* must manually be requested from locale.h
*/
#include <locale.h>
dTHR; /* needed for older threaded perls */
struct lconv *lc = localeconv();
char *radix = lc->decimal_point;
if (radix && IN_LOCALE) {
STRLEN len = strlen(radix);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
view all matches for this distribution
view release on metacpan or search on metacpan
ninstr|||
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
not_a_number|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
offer_nice_chunk|||
oopsAV|||
oopsHV|||
#endif
/* Hint: PL_ppaddr
* Calling an op via PL_ppaddr requires passing a context argument
* for threaded builds. Since the context argument is different for
* 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
* automatically be defined as the correct argument.
*/
#if (PERL_BCDVERSION <= 0x5005005)
#endif
/*
* Boilerplate macros for initializing and accessing interpreter-local
* data from C. All statics in extensions should be reworked to use
* this, if you want to make the extension thread-safe. See ext/re/re.xs
* for an example of the use of these macros.
*
* Code that uses these macros is responsible for the following:
* 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
* 2. Declare a typedef named my_cxt_t that is a structure that contains
defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
#ifndef START_MY_CXT
/* This must appear in all extensions that define a my_cxt_t structure,
* right after the definition (i.e. at file scope). The non-threads
* case below uses it to declare the data as static. */
#define START_MY_CXT
#if (PERL_BCDVERSION < 0x5004068)
/* Fetches the SV that keeps the per-interpreter data. */
#else
/* older perls don't have PL_numeric_radix_sv so the radix
* must manually be requested from locale.h
*/
#include <locale.h>
dTHR; /* needed for older threaded perls */
struct lconv *lc = localeconv();
char *radix = lc->decimal_point;
if (radix && IN_LOCALE) {
STRLEN len = strlen(radix);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
view all matches for this distribution
view release on metacpan or search on metacpan
libnova-0.15.0/aclocal.m4 view on Meta::CPAN
_LT_TAGVAR(link_all_deplibs, $1)=unknown
_LT_TAGVAR(module_cmds, $1)=
_LT_TAGVAR(module_expsym_cmds, $1)=
_LT_TAGVAR(old_archive_from_new_cmds, $1)=
_LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
_LT_TAGVAR(thread_safe_flag_spec, $1)=
_LT_TAGVAR(whole_archive_flag_spec, $1)=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
_LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
libnova-0.15.0/aclocal.m4 view on Meta::CPAN
_LT_TAGDECL([], [postlink_cmds], [2],
[Commands necessary for finishing linking programs])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
dnl [Compiler flag to generate thread safe objects])
])# _LT_LINKER_SHLIBS
# _LT_LANG_C_CONFIG([TAG])
# ------------------------
view all matches for this distribution
view release on metacpan or search on metacpan
* SLA.pm: Release Version 0.97 on CPAN
2003-07-14 Tim Jenness <tjenness@cpan.org>
* SLA.xs: Need to add aTHX_ for Perl_croak to work with threads
2003-07-03 Tim Jenness <tjenness@cpan.org>
* SLA.xs: Fix error in slaOap fortran interface. This was breaking
the comet test. Does not affect the C version.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Async/Chain.pm view on Meta::CPAN
=head1 RATIONALE
A asynchronous code often have deep nested callbacks, therefore it is tangled
and hard to change. This module help to converta a code like following to some
more readable form. Also, with C<chain> you can easily skip some unneeded steps
in this thread. For example jump to log step after the first failed query in
the chain.
without chain:
sub f {
view all matches for this distribution
view release on metacpan or search on metacpan
calls. It just run the passed subroutines and keep count of the
call-back functions called by the aforementionned subroutines. When
all these subs are finished, it calls another call-back (passed by the
user) to perform whatever function required by the user.
Using fork or threads or whatever is left to the user.
=head1 Methods
=head2 new( set => [sub, sub, ...], [test => 1] )
view all matches for this distribution
view release on metacpan or search on metacpan
Interrupt.pm view on Meta::CPAN
This module implements a single feature only of interest to advanced perl
modules, namely asynchronous interruptions (think "UNIX signals", which
are very similar).
Sometimes, modules wish to run code asynchronously (in another thread,
or from a signal handler), and then signal the perl interpreter on
certain events. One common way is to write some data to a pipe and use an
event handling toolkit to watch for I/O events. Another way is to send
a signal. Those methods are slow, and in the case of a pipe, also not
asynchronous - it won't interrupt a running perl interpreter.
This module implements asynchronous notifications that enable you to
signal running perl code from another thread, asynchronously, and
sometimes even without using a single syscall.
=head2 USAGE SCENARIOS
=over 4
Interrupt.pm view on Meta::CPAN
completely.
This can be used to implement the signal handling in event loops,
e.g. L<AnyEvent>, L<POE>, L<IO::Async::Loop> and so on.
=item Background threads want speedy reporting
Assume you want very exact timing, and you can spare an extra cpu core
for that. Then you can run an extra thread that signals your perl
interpreter. This means you can get a very exact timing source while your
perl code is number crunching, without even using a syscall to communicate
between your threads.
For example the deliantra game server uses a variant of this technique
to interrupt background processes regularly to send map updates to game
clients.
Interrupt.pm view on Meta::CPAN
L<IO::AIO> and L<BDB> could also use this to speed up result reporting.
=item Speedy event loop invocation
One could use this module e.g. in L<Coro> to interrupt a running coro-thread
and cause it to enter the event loop.
Or one could bind to C<SIGIO> and tell some important sockets to send this
signal, causing the event loop to be entered to reduce network latency.
Interrupt.pm view on Meta::CPAN
warn "signal $_ received\n";
}
}
}
=head2 Interrupt perl from another thread
This example interrupts the Perl interpreter from another thread, via the
XS API. This is used by e.g. the L<EV::Loop::Async> module.
On the Perl level, a new loop object (which contains the thread)
is created, by first calling some XS constructor, querying the
C-level callback function and feeding that as the C<c_cb> into the
Async::Interrupt constructor:
my $self = XS_thread_constructor;
my ($c_func, $c_arg) = _c_func $self; # return the c callback
my $asy = new Async::Interrupt c_cb => [$c_func, $c_arg];
Then the newly created Interrupt object is queried for the signaling
function that the newly created thread should call, and this is in turn
told to the thread object:
_attach $self, $asy->signal_func;
So to repeat: first the XS object is created, then it is queried for the
callback that should be called when the Interrupt object gets signalled.
Then the interrupt object is queried for the callback function that the
thread should call to signal the Interrupt object, and this callback is
then attached to the thread.
You have to be careful that your new thread is not signalling before the
signal function was configured, for example by starting the background
thread only within C<_attach>.
That concludes the Perl part.
The XS part consists of the actual constructor which creates a thread,
which is not relevant for this example, and two functions, C<_c_func>,
which returns the Perl-side callback, and C<_attach>, which configures
the signalling functioon that is safe toc all from another thread. For
simplicity, we will use global variables to store the functions, normally
you would somehow attach them to C<$self>.
The C<c_func> simply returns the address of a static function and arranges
for the object pointed to by C<$self> to be passed to it, as an integer:
Interrupt.pm view on Meta::CPAN
CODE:
{
my_sig_func = sig_func;
my_sig_arg = sig_arg;
/* now run the thread */
thread_create (&u->tid, l_run, 0);
}
And C<l_run> (the background thread) would eventually call the signaling
function:
my_sig_func (my_sig_arg, 0);
You can have a look at L<EV::Loop::Async> for an actual example using
intra-thread communication, locking and so on.
=head1 THE Async::Interrupt CLASS
=over 4
Interrupt.pm view on Meta::CPAN
An example call would look like:
signal_func (signal_arg, 0);
The function is safe to call from within signal and thread contexts, at
any time. The specified C<value> is passed to both C and Perl callback.
C<$value> must be in the valid range for a C<sig_atomic_t>, except C<0>
(1..127 is portable).
Interrupt.pm view on Meta::CPAN
afterwards.
Note that there must be exactly one call of C<unblock> for every previous
call to C<block> (i.e. calls can nest).
Since ensuring this in the presence of exceptions and threads is
usually more difficult than you imagine, I recommend using C<<
$async->scoped_block >> instead.
=item $async->scope_block
This call C<< $async->block >> and installs a handler that is called when
the current scope is exited (via an exception, by canceling the Coro
thread, by calling last/goto etc.).
This is the recommended (and fastest) way to implement critical sections.
=item ($block_func, $block_arg) = $async->scope_block_func
view all matches for this distribution
view release on metacpan or search on metacpan
examples/slow-redis/app.pl view on Meta::CPAN
1 second before returning a response. Despite the delay, the server can
handle many concurrent requests because the sleep is non-blocking.
With traditional blocking I/O:
- 5 sequential requests = 5 seconds
- 5 concurrent requests to a single-threaded server = 5 seconds
With non-blocking I/O (this example):
- 5 sequential requests = 5 seconds
- 5 concurrent requests = ~1 second (all sleep concurrently)
view all matches for this distribution