Created
February 25, 2014 11:52
-
-
Save unbit/9207516 to your computer and use it in GitHub Desktop.
Embedding PyPy in C/C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call rpython_startup_code(); for initializing | |
call pypy_setup_home(char *home, int debug); for setting the python home (returns non-zero on error, you can call it multiple times until it succeed) | |
call pypy_execute_source(char *code); execute the python code (IMPORTANT: GIL is still not set here) | |
call pypy_init_threads(); initialize GIL | |
finally call pypy_thread_attach(); in each additional pthread you need to register to python (this function is not thread safe, you should call it under a mutex) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment