Skip to content

ndiCommand doesn't release Python GIL #51

Description

@MattClarkson

When running "multi-threaded" python apps, libraries like OpenCV release the Python GIL so that while C/C++ is executing, the python interpreter has the opportunity to do something else.

If you run an NDI tracker, at say 40-60 FPS the holding of the GIL can block the rest of your application.

Suggest we do something like:

    const char* cmd_cstr = PyString_AsString(newstring);
    // Assumes caller manages threads.
    Py_BEGIN_ALLOW_THREADS
    result = ndiCommand(pol, "%s", cmd_cstr);
    Py_END_ALLOW_THREADS

in ndicapimodule.cxx

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