=head1 NAME Coro::Multicore - make coro threads on multiple cores with specially supported modules =head1 SYNOPSIS use Coro::Multicore; =head1 DESCRIPTION While L threads (unlike ithreads) provide real threads similar to pthreads, python threads and so on, they do not run in parallel to eahc other even on machines with multiple CPUs or multiple CPU cores. This module lifts this restriction under two very specific but useful conditions: firstly, the coro thread executes in XS code and does not touch any perl data structures, and secondly, the XS code is specially prepared to allow this. This means that, when you call an XS function of a module prepared for it, this XS function can execute in parallel to any other Coro threads. The mechanism to support this is easily added to existing modules and is independent of L or L, and therefore could be used, without changes, with other, similar, modules, or even the perl core, should it gain real thread support anytime soon. SEe L for more info on how to prepare a module to allow parallel execution. =over 4 =cut package Coro::Multicore; use Coro (); use AnyEvent (); BEGIN { our $VERSION = 0.02; use XSLoader; XSLoader::load __PACKAGE__, $VERSION; } our $WATCHER = AE::io fd, 0, \&poll; =back =head1 AUTHOR Marc Lehmann http://software.schmorp.de/pkg/AnyEvent-XSThreadPool.html =cut 1