Skip to content

Releasing GIL While Processing #29

@revarbat

Description

@revarbat

If you could release the Global Interpreter Lock while doing more CPU intensive calls to ClipperLib (union, difference, intersection, minkowski, offset, etc), it would allow Python apps to parallelize much better when using threading. I wrote a 3D printing slicer program in Python called Mandoline-Py ( https://github.com/revarbat/mandoline-py ), and ran headlong into the performance limitations of the GIL.

As best as I can tell, this should be just a matter of surrounding the CPU intensive code with Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS. (See https://docs.python.org/3/c-api/init.html#thread-state-and-the-global-interpreter-lock )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions