9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] What is required of an open file to be used in ape/select?
@ 2002-04-09 14:29 bwc
  0 siblings, 0 replies; 6+ messages in thread
From: bwc @ 2002-04-09 14:29 UTC (permalink / raw)
  To: 9fans

> I'm not convinced you want to go down this path.  It's
> almost always easier to use libthread and have separate
> procs reading from fds and passing data pointers back to a
> main proc.

I agree.  But I'm trying to write some stuff that will port
easily to Unix machines.

 Brantley


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9fans] What is required of an open file to be used in ape/select?
@ 2002-04-09 18:46 forsyth
  0 siblings, 0 replies; 6+ messages in thread
From: forsyth @ 2002-04-09 18:46 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 83 bytes --]

i did use it for that reason under second edition
and it worked as i expected.


[-- Attachment #2: Type: message/rfc822, Size: 1608 bytes --]

To: 9fans@cse.psu.edu
Subject: Re: [9fans] What is required of an open file to be used in ape/select?
Date: Tue, 9 Apr 2002 10:29:07 -0400
Message-ID: <20020409142546.E3C7919A7A@mail.cse.psu.edu>

> I'm not convinced you want to go down this path.  It's
> almost always easier to use libthread and have separate
> procs reading from fds and passing data pointers back to a
> main proc.

I agree.  But I'm trying to write some stuff that will port
easily to Unix machines.

 Brantley

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9fans] What is required of an open file to be used in ape/select?
@ 2002-04-09 14:28 Russ Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Russ Cox @ 2002-04-09 14:28 UTC (permalink / raw)
  To: 9fans

> I have a server in user space that I mount on /n/ed.  It contains
> a file, /n/ed/cmsg.  What behavior must /n/ed/cmsg have to be
> useful with ape/select?  I wish to read when a control message arrives
> at the file.

I think that all files are equal in the eyes of ape select.
(Of course, it could be that select is broken and doesn't
work on any files.  I assume you tried selecting on
/n/ed/cmsg and it didn't work.)

I'm not convinced you want to go down this path.  It's
almost always easier to use libthread and have separate
procs reading from fds and passing data pointers back to a
main proc.

[addendum:]

Reading /n/ed/cmsg definitely needs to block until a control
message comes in.  This sometimes gets annoying because it
makes things like "cat /n/ed/cmsg" not as useful.  One sleazy
way around it is to keep track of whether you've returned eof
yet to this reader, and define that reads after one eof will block.
APE select doesn't give up reading the fd until it gets three eofs
(a heuristic to try to avoid problems with zero-length messages
in pipes).

Russ



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9fans] What is required of an open file to be used in ape/select?
@ 2002-04-09 14:23 Russ Cox
  2002-04-09 14:27 ` Boyd Roberts
  0 siblings, 1 reply; 6+ messages in thread
From: Russ Cox @ 2002-04-09 14:23 UTC (permalink / raw)
  To: 9fans

> I have a server in user space that I mount on /n/ed.  It contains
> a file, /n/ed/cmsg.  What behavior must /n/ed/cmsg have to be
> useful with ape/select?  I wish to read when a control message arrives
> at the file.

I think that all files are equal in the eyes of ape select.
(Of course, it could be that select is broken and doesn't
work on any files.  I assume you tried selecting on
/n/ed/cmsg and it didn't work.)

I'm not convinced you want to go down this path.  It's
almost always easier to use libthread and have separate
procs reading from fds and passing data pointers back to a
main proc.

Russ



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [9fans] What is required of an open file to be used in ape/select?
@ 2002-04-09 14:18 bwc
  0 siblings, 0 replies; 6+ messages in thread
From: bwc @ 2002-04-09 14:18 UTC (permalink / raw)
  To: 9fans

I have a server in user space that I mount on /n/ed.  It contains
a file, /n/ed/cmsg.  What behavior must /n/ed/cmsg have to be
useful with ape/select?  I wish to read when a control message arrives
at the file.

  Brantley Coile


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-04-09 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-09 14:29 [9fans] What is required of an open file to be used in ape/select? bwc
  -- strict thread matches above, loose matches on Subject: below --
2002-04-09 18:46 forsyth
2002-04-09 14:28 Russ Cox
2002-04-09 14:23 Russ Cox
2002-04-09 14:27 ` Boyd Roberts
2002-04-09 14:18 bwc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).