[Numpy-discussion] Threading question for Travis

Charles R Harris charlesr.harris@gmail....
Sat Apr 26 05:47:59 CDT 2008


Travis,

Is this correct?

    NPY_LOOP_BEGIN_THREADS;
    switch(loop->meth) {
    case ONE_UFUNCLOOP:
        /*
         * Everything is contiguous, notswapped, aligned,
         * and of the right type.  -- Fastest.
         * Or if not contiguous, then a single-stride
         * increment moves through the entire array.
         */
        /*fprintf(stderr, "ONE...%d\n", loop->size);*/
        loop->function((char **)loop->bufptr, &(loop->size),
                loop->steps, loop->funcdata);
        UFUNC_CHECK_ERROR(loop);
        break;

Note that UFUNC_CHECK_ERROR calls PyErr_Occurred. That doesn't seem thread
safe to me. Or maybe there is something special about that function I'm
missing.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080426/a3addd36/attachment.html 


More information about the Numpy-discussion mailing list