Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 08-03-2009, 09:48 PM   #1
LQ Newbie
Registered: Aug 2009
Posts: 2

Rep: Reputation: 0
Question cancelling pending/blocking reads/writes

I'm writing a driver for a custom hardware widget. It's a character device. I'd like to have the file acessed by multiple threads with one of the threads blocking on a read. Is there some way, from the main task, to have that blocking read complete when either I:

-send some ioctl to the fd
-close the fd

Ideally I'd like to have this read thread waiting for data to come in while another thread is either doing writes or ioctls (out of band signaling) and then when someone decides to shut things down, have that thread with the read complete (EBADF? or something like that) to indicate to the thread that it should exit.

Can I just have the ioctl pull the exclusive reader off the wait queue, returning some unique error? Or will a close from one thread cause that read to complete without any action on my part?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java File reads and writes manolakis Programming 2 04-08-2009 12:52 PM
Ratio of Reads/Writes on disk erimar77 Linux - Server 2 08-22-2006 11:16 PM
CD R/RW: reads or writes but not both hatha Linux - General 6 04-17-2005 07:12 PM
shouldn't disk writes be slower than reads jwstric2 General 0 08-28-2004 11:01 PM
cdburner reads not writes NGraphiX Linux - Hardware 1 02-28-2003 04:29 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration