Thread blockage
Why do thread block in Input/output?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chintan RathodRank #516 · 4.8K reputationPosted Dec 28, 2011, 8:19 AM EST
A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.
Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority.So, while any higher priority thread is running and it requires any input from the user or need to generate an output to the screen. At that time what happen, until input is not given from the user, thread is not capable to go ahead because of the inputted data. Same in output also, until processor finishes operation of the output, it will no go on further process.
So, as the priority of the thread, it is feasible to put that thread in block state, because it is doing nothing at that time, and utilize other threads which are running concurrently.
Thank you.
Sam HobbsRank #107 · 20.5K reputationPosted Dec 28, 2011, 3:36 PM EST
IO takes time. For disk drives, the computer has to wait for the data to betransfered from the disk controller to computer memory. That does not take much time but it takes more time for the disk drive to wait for the hard drive platters to spin around to the data. If the hard drive needs to seek, then it takes much more time for the drive to move the readwrite heads to the location on the hard drive platters where the data is. The computer can do many things very quickly and a disk drive is very, very slow in comparison. The computer can go as fast as a jet plane compared to a car on the ground. A jet plane has to wait for the paseengers in cars to get to the airport. Threads in computers are sometimes like that.