I have the following Python code (I thinks my question applies to every programming language):
from threading import Thread, BoundedSemaphore
# ... other things ...
mutex = BoundedSemaphore()
def some_function():
with mutex:
# do something with a globally available object
Thread(target=some_function).start()
# do something else after the thread invokation
Many threads starting some_function
are invoked but only one of such threads is executing due to the mutex.
My question is: can I reach a point where my operating system cannot handle such a number of thread even if there is only one thread executing at a time? I already searched for an answer (like this thread but this talks about measuring) but no one mentioned nothing about interrupted threads.
Thanks in advance for your time and your answers. :)