Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Sep 25, 2024

This PR updates the CheckSignals function to grab GIL. This is needed because we now explicitly release gil when calling any C functions. GIL will need to be obtained otherwise we will run into segfault when checking the signal.

The update now enables us to run ctrl + C in long running C functions.

@tqchen
Copy link
Member Author

tqchen commented Sep 25, 2024

run the following code and press control + C to check if signal is intercepted in python

import numpy as np
import tvm


def main():
    print("start")
    tvm.get_global_func("testing.check_signals")(0.01)
    print("good")

main()

This PR updates the CheckSignals function to grab GIL.
This is needed because we now explicitly release gil when calling
any C functions. GIL will need to be obtained otherwise we will
run into segfault when checking the signal.

The update now enables us to run ctrl + C in long running C functions.
@MasterJH5574
Copy link
Contributor

@tvm-bot rerun

@tqchen tqchen merged commit 5e85443 into apache:main Sep 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants