Writing to a file using cython.parallel.parallel and nogil

I get urine from Keaton. Think about how to do it. Writing to a very large file is the main bottleneck in my code, so I thought I would look into parallelism, but I could not find anything useful when writing files using parallelism.

Can i use

with nogil, parallel():

with writing to a file? I get compilation errors when I try to write a line:

Constructing Python tuple not allowed without gil
+3
source share
1 answer

Python nogil. IO nogil, C. . , cimport C stdio. nogil. , :

from libc.stdio cimport *

cdef extern from "stdio.h":
    FILE *fopen(const char *, const char *)
    int fclose(FILE *)
    ssize_t getline(char **, size_t *, FILE *)
+3

All Articles