From: Richard B. Johnson
Date: Fri Jun 18 2004 - 06:24:52 EST
On Thu, 17 Jun 2004, Ben Greear wrote:
> Richard B. Johnson wrote:
> > On Thu, 17 Jun 2004, Ben Greear wrote:
> >>Richard B. Johnson wrote:
> >>>Is it okay to use the 'extra' bits in the poll return value for
> >>>something? In other words, is the kernel going to allow a user-space
> >>>program to define some poll-bits that it waits for, these bits
> >>>having been used in the driver?
> >>Can't you just do a read and determine from the results of the read
> >>what you actually got? If not, add framing to your message so that
> >>you *CAN* determine one message type from another...
> > The mailbox read(s) is/are 32-bit int(s). There is no way to identify
> > it as being "new" or something that was written two weeks ago.
> > That's why we use poll. Poll says 'I got something new for you'.
> Then use 3 different file descriptors to poll/read. That seems more
> efficient anyway as it doesn't wake the folks who don't care.
Huh?? The driver has no clue what open file-descriptor needs
whatever special handling. When a polled-for event occurs, a
bit is put into what will be the poll return value in the driver
and any process sleeping in poll ** that is waiting for that bit **
gets awakened. That's why I need to use some of the "spare" bits.
Only the task that's waiting for its specific bit gets awakened
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/