LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 08-03-2009, 10:48 PM   #1
mincher
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?

Thanks,
Dick
 
  


Reply


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 01:52 PM
Ratio of Reads/Writes on disk erimar77 Linux - Server 2 08-23-2006 12:16 AM
CD R/RW: reads or writes but not both hatha Linux - General 6 04-17-2005 08:12 PM
shouldn't disk writes be slower than reads jwstric2 General 0 08-29-2004 12:01 AM
cdburner reads not writes NGraphiX Linux - Hardware 1 02-28-2003 05:29 AM


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

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