Async-Trampoline

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.001002  2017-09-23 17:07:57+00:00 UTC

    - support Perls with threading/multiplicity
    - support compilation under Windows

0.001001  2017-09-22 14:16:56+00:00 UTC

    - better compiler compatibility down to GCC 4.7
    - don't break compilation if CXXFLAGS env var is set
    - specify Test::Exception as test dependency
    - other distribution quality improvements

0.001000  2017-09-19

lib/Async/Trampoline.pm  view on Meta::CPAN


This module does not provide first-class Future objects.
While Asyncs are Future-like, you cannot resolve an Async explicitly.
Check out the L<Future|Future> module instead.

This module does not implement an event loop.
The C<run_until_completion()> function does run a dispatch loop,
but there is no concept of events, I/O, or timers.
Check out the L<IO::Async|IO::Async> module instead.

This module is not thread-aware.
Handling the same Async on multiple threads is undefined behaviour.

This module does not detect infinite loops.
It is your responsibility to ensure
that Async dependencies don't form cycles.

This module does not guarantee any particular evaluation order.
If you need a specific sequence, you must encode it explicitly
(see L<Combining Asyncs|/"COMBINING ASYNCS">).
Note that the combinators do not declare
a partial order between one or more Asyncs,

src/ppport.h  view on Meta::CPAN

next_symbol|||
nextargv|||
nextchar|||
ninstr|||n
no_bareword_allowed|||
no_fh_allowed|||
no_op|||
noperl_die|||vn
not_a_number|||
not_incrementable|||
nothreadhook||5.008000|
nuke_stacks|||
num_overflow|||n
oopsAV|||
oopsHV|||
op_append_elem||5.013006|
op_append_list||5.013006|
op_clear|||
op_contextualize||5.013006|
op_convert_list||5.021006|
op_dump||5.006000|

src/ppport.h  view on Meta::CPAN

U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
#else
extern U32 DPPP_(my_PL_signals);
#endif
#define PL_signals DPPP_(my_PL_signals)

#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 src/ppport.h), which will
 * automatically be defined as the correct argument.
 */

#if (PERL_BCDVERSION <= 0x5005005)
/* Replace: 1 */
#  define PL_ppaddr                 ppaddr
#  define PL_no_modify              no_modify
/* Replace: 0 */
#endif

src/ppport.h  view on Meta::CPAN

        PL_curcop->cop_stash = old_cop_stash;
        PL_curstash = old_curstash;
        PL_curcop->cop_line = oldline;
}
#endif
#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
 *    all the data that needs to be interpreter-local.
 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
 *    (typically put in the BOOT: section).
 * 5. Use the members of the my_cxt_t structure everywhere as

src/ppport.h  view on Meta::CPAN

 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
 *    access MY_CXT.
 */

#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
    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. */
#define dMY_CXT_SV \
        SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
#else /* >= perl5.004_68 */
#define dMY_CXT_SV \
        SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,             \

src/ppport.h  view on Meta::CPAN

        if (*sp + len <= send && memEQ(*sp, radix, len)) {
            *sp += len;
            return TRUE;
        }
    }
#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)) {
            *sp += len;
            return TRUE;
        }
    }
#endif



( run in 1.107 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )