Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

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

1 Answer

0 votes
by (106k 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
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...