Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

definition not found: nogil-3.9.10-1 #118

Open
xuanvuzzz2601 opened this issue Aug 3, 2023 · 3 comments
Open

definition not found: nogil-3.9.10-1 #118

xuanvuzzz2601 opened this issue Aug 3, 2023 · 3 comments

Comments

@xuanvuzzz2601
Copy link

I try "pyenv install nogil-3.9.10-1" but did not succeed.

[info]:
:: [Info] :: Mirror: https://www.python.org/ftp/python
pyenv-install: definition not found: nogil-3.9.10-1

See all available versions with pyenv install --list.
Does the list seem out of date? Update it using pyenv update.
image

@colesbury
Copy link
Owner

Hi @xuanvuzzz2601 - I don't think pyenv for Windows supports nogil (only pyenv for Linux and macOS). You can use the Windows installer from here: https://github.com/colesbury/nogil/releases (python-3.9.10-amd64.exe), but be warned that there are fewer support C-API extensions for nogil on Windows than for Linux or macOS.

@xuanvuzzz2601
Copy link
Author

I have tested running the results of 2 programs with GIL and NOGIL but it doesn't seem to work on window. Please let me know what setup is needed for it to work.

imageimage

@pjurgielewicz
Copy link

Hi @xuanvuzzz2601, what is your definition of working/not working? How do you invoke your script? I have run your example (with slight enhancements):

from threading import Thread
import time
import sys

print(sys.flags)

COUNT = 50000000

def countdown(n):
    while n>0:
        n -= 1

# 1st pass
start = time.time()
countdown(COUNT)
end = time.time()
print('Time taken in seconds -', end - start)

# 2nd pass
t1 = Thread(target=countdown, args=(COUNT//2,))
t2 = Thread(target=countdown, args=(COUNT//2,))

start = time.time()
t1.start()
t2.start()

t1.join()
t2.join()

end = time.time()
print('Time taken in seconds -', end - start)

And I got the following result running py -3.9 .\test.py (I do not have regular CPython 3.9 installed on my Windows machine)

sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0, dev_mode=False, nogil=True)
Time taken in seconds - 2.3499691486358643
Time taken in seconds - 1.1804711818695068

Please note that the nogil flag is set to True, indicating that nogil is being used. Please check and compare it on your system.

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

No branches or pull requests

3 participants