Hi

On Wed, May 6, 2009 at 11:58 AM, jasjit singh <[email protected]> wrote:
> Hi
> I am using work queue to do bottom half processing in my driver. The
> function queue_work() doesn't enqueue the work if the work_struct is already
> in the queue. I want to know how this phenomenon is synchronized. Suppose I
> have enqueued a work which calls the function do_this_work(). Now the
> do_this_work() has been invoked and not finished yet. So if there is an
> interrupt while processing of this function, will the new work be enqueued
> or the queue_work() still give an error ?
> What I could think is when the kernel starts processing do_this_work(), it
> resets some flag so that more work can be enqueued to the work queue. Does
> it behave like this or not ? Please elaborate the scenario if u can.


Looking at the source, specifically kernel/workqueue.c on function
run_workqueue()... I saw locking mechanism. I believe it's using
spin_lock_irq(), thus for current CPU, the interrupt is temporarily
disabled. Furthermore, I conclude that at this point, interrupt won't
trigger the execution of work queue at this point.

CMIIW people.

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to