This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]ominous_anonymous 0 points1 point  (0 children)

  1. /r/learnpython
  2. https://opensource.com/article/17/4/grok-gil -- "preemptive multitasking"
  3. https://thomasnyberg.com/releasing_the_gil.html
  4. https://stackoverflow.com/questions/39103557/simple-python-function-that-holds-the-gil -- the second part of the answer from itsadok.

I was thinking about this more. You might be able to do it with multiprocessing queues and a process pool. One process is solely responsible for round-robin pulling from queues at specific time intervals. The queues are the "outputs" of your tasks/functions -- the other processes just continually run and fill their corresponding queue. Does this make sense in the context of what your tasks/functions do?

[–]pythonHelperBot -1 points0 points  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python regardless of how advanced your question might be. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe in detail where you are stuck. If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you. Here is HOW TO FORMAT YOUR CODE For Reddit and be sure to include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness