This sleep() function takes one single argument which specifies the time in seconds for which the execution of the thread or the process must be suspended. Other CPU operations will function adequately but sleep() will delay a specific thread only. Sleep function in C++ is used to suspend the execution of a thread or a process for a specified period of time temporarily. On the other hand, threads are interdependent and share memory. Please remember that processes are independent of each other and hence don't share a memory or other resources. Thread is a segment of a process or a lightweight process that is managed by the scheduler independently. The Process is a program in the execution phase or an instance of a program that is being executed or processed is called Process. Let's check the easy definitions of both these terms. But we need to revise some prerequisites like process and threads first. There are numerous operations provided by the operating system to us, one of them is the sleep() function.īefore going into detail, let's just first cover the basic terminologies we will use in between.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |