Locking Between Tasklets/Timers
Prev | Chapter 3. Locking in the Linux Kernel | Next

## Locking Between Tasklets/Timers

Sometimes a tasklet or timer might want to share data with another tasklet or timer.

### The Same Tasklet/Timer

Since a tasklet is never run on two CPUs at once, you don't need to worry about your tasklet being reentrant (running twice at once), even on SMP.

### Different Tasklets/Timers

If another tasklet/timer wants to share data with your tasklet or timer , you will both need to use `spin_lock()` and `spin_unlock()` calls. `spin_lock_bh()` is unnecessary here, as you are already in a tasklet, and none will be run on the same CPU.

Prev | Up | Next
Locking Between User Context and Timers | Home | Locking Between Softirqs