Find the answer to your Linux question:
Results 1 to 2 of 2
Hello everyone, I've got a question about race conditions. I'm writing the dev.drv and have to share some data between user processes(sys.call) and tasklet. The shared data is stored in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2

    Race conditions


    Hello everyone, I've got a question about race conditions.
    I'm writing the dev.drv and have to share some data between user processes(sys.call) and tasklet.
    The shared data is stored in cyclic queue.
    My write() sys.call pushing the data to queue and the tasklet pulling the data and writing it to I/O port.
    Do I have to use some lock/unlock mechanisms to protect my deque(), enqueue() functions?
    The tasklet could be raised by HW INT or from my write() sys.call.
    The kernel version is 2.4.32 and the arch. is I386.

    Thanks a lot.

  2. #2
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    Location
    Holland
    Posts
    301
    Quote Originally Posted by bertie
    My write() sys.call pushing the data to queue and the tasklet pulling the data and writing it to I/O port.
    Do I have to use some lock/unlock mechanisms to protect my deque(), enqueue() functions?
    I think yes. The queue and unqueue operations will be not atomic... so I think you need synchronization in order to prevent race conditions. Now I can't tell you more... but you can find more info in LDD.

    Best Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •