Answer the question
In order to leave comments, you need to log in
Why use the poll system call to wait for an event from the driver?
There is a process thread that calls the driver's read in a loop. Why use the poll function with a timeout before calling read. Thus, spending some time "reloading" the poll function if a timeout occurs. Why not immediately block the thread with a read call and wait until the data is available, thereby not wasting precious processor cycles (the only option that comes to mind is when you need to force the thread to be slammed and if you use a timeout, then you do not need to interrupt the system call, although if forcibly terminate the thread, then the kernel, in theory, will itself interrupt the system call)? Is this true, maybe something else?
Answer the question
In order to leave comments, you need to log in
Why not immediately block the thread with a call to read and wait until the data is available
(only one option comes to mind when it is necessary to forcefully kill the thread and if you use a timeout, then you do not need to interrupt the system call, although if you force the thread to end, then the kernel, in theory, will interrupt the system call itself)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question