[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom ["stuart warren" <swarren@btr-auto.aust.com>] (fwd)



>From owner-rtl Thu May 10 16:38:02 2001
Received: from mta05.mail.mel.aone.net.au (mta05.mail.au.uu.net [203.2.192.85])
	by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4AMc1J01909
	for <rtl@fsmlabs.com>; Thu, 10 May 2001 16:38:01 -0600
Received: from BTR-COM1.btr-auto.aust.com ([203.108.33.26])
          by mta05.mail.mel.aone.net.au with SMTP
          id <20010510223352.FHCQ10022.mta05.mail.mel.aone.net.au@BTR-COM1.btr-auto.aust.com>;
          Fri, 11 May 2001 08:33:52 +1000
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: [rtl] query regarding select system call 
Content-Type: text/plain;
	charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0
Date: Fri, 11 May 2001 08:35:14 +1000
Message-ID: <A3A5582AC3AFD448A7C0BD2DB7EFDC5F07E8EA@BTR-COM1.btr-auto.aust.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [rtl] query regarding select system call 
Thread-Index: AcDZTCclUtInAc0QRAaiT48uV0iUDQAUMDEQ
From: "stuart warren" <swarren@btr-auto.aust.com>
To: <rtl@fsmlabs.com>, <rtl@rtlinux.org>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by hq.fsmlabs.com id f4AMc2J01911

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/