[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [rtl] query regarding select system call
- To: <rtl@fsmlabs.com>, <rtl@rtlinux.org>
- Subject: RE: [rtl] query regarding select system call
- From: "stuart warren" <swarren@btr-auto.aust.com>
- Date: Fri, 11 May 2001 08:35:14 +1000
- Thread-Index: AcDZTCclUtInAc0QRAaiT48uV0iUDQAUMDEQ
- Thread-Topic: [rtl] query regarding select system call
Vijay,
AFAIK, select can't tell if the file is added to unless the file is a
named pipe (fifo) or /dev/... For regular files, select will keep on
FD_ISSETing until the end of the file, where it repeatedly give you
zero-length reads until you close the file.
Maybe the easiest way is to use a (non-rtl) fifo to synchronise the two
tasks. Create a fifo (mkfifo) and read it from task to be notified.
The task will be blocked until the other task writes data to the fifo.
That way you can do something like this...
Task 1 - Opens fifo for writing
Task 2 - Opens fifo for reading, reads fifo (os puts task to sleep)
...
Task 1 - Saves some data to fs, finishes write, writes a character to
fifo
Task 2 - Task woken by os. Read data from fs. Read fifo (os puts to
sleep).
Task 1 - Saves some data to fs, finishes write, writes a character to
fifo
Task 2 - Task woken by os. Read data from fs. Read fifo (os puts to
sleep).
etc...
cheers,
Stuart Warren
-----Original Message-----
From: vijay patel [mailto:vkpatel@ipr.res.in]
Sent: Friday, 11 May 2001 6:48
To: rtl@rtlinux.org
Subject: [rtl] query regarding select system call
Hello ,
This is a general quest. not specific to RT- linux.
I have created a ramdisk drive, Now can I creat a task
that should be notify of data to be written on ramdisk
by another task.
Can u suggest the techniques to achieve to this.
I tried it with select system call,but it is not working.
Can we use select for any file ( residing on floppy or harddisk)
The doubt is that once the data is written on the media, it
will available immediately & will remain there .
Thanking you
-Vijay Patel
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/