Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Python Concurrency Decorators
41–50 of 51 posts
Re: Python Concurrency Decorators
#42Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all the function is doing is actual computation (i.e. using the CPU), no other code can run in parallel with it because of the GIL.
Re: Python Concurrency Decorators
#43gave me the chills
Re: Python Concurrency Decorators
#44Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all the function is doing is actual computation (i.e. using the CPU), no other code can run in parallel with it because of the GIL.
Re: Python Concurrency Decorators
#45Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all the function is doing is actual computation (i.e. using the CPU), no other code can run in parallel with it because of the GIL.
* running multiple Database queries
* SSH-ing into multiple devices to run a command
* loading multiple web pages
* calling multiple APIs
Re: Python Concurrency Decorators
#46Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Re: Python Concurrency Decorators
#47Re: Python Concurrency Decorators
#48Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all the function is doing is actual computation (i.e. using the CPU), no other code can run in parallel with it because of the GIL.
Re: Python Concurrency Decorators
#49Another page you might be interested in bookmarking: https://wiki.python.org/moin/PythonDecoratorLibrary A similar decorator to thread function calls for concurrency: https://wiki.python.org/moin/PythonDecoratorLibrary#Lazy_Thu...
Never heard this name for this pattern (thunk). Isn't this the same as a Future/Promise object?
Re: Python Concurrency Decorators
#50A couple of things offhand: - It has Python 2 and 3 support - It's a wrapper for the Python built-in "multiprocessing" library - It spreads out work over all cores (so the abstraction hides the ability to control the pool) Seems like a great way to get your feet wet with multiprocessing in Python, but it likely has limited use in production...although certain infrastructures like resource limited containers might be…
Is there no way to specify the number of cores to use?