0 votes
1 view
in Python by (47.8k points)

In Python for *nix, does time.sleep() block the thread or the process?

1 Answer

0 votes
by (107k points)

Yes, in Python the time.sleep() function blocks the thread.It allowing other threads to continue to execute while the current one sleeps. You can also test this with a simple python program:

It allows other threads to sleep except in the case where your application has only a single thread, in that case, it will sleep the thread and effectively the process as well.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 9, 2019 in Java by Nigam (4.1k points)
+2 votes
2 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...