[openbeosnetteam] Re: It build again !

Axel replied:
>> Can you explain what's your new select even notification api is?
> 
> It's simple:
> status_t notify_select_event(selectsync *sync, uint32 ref, uint8 
> event);
> 
> Instead of:
> void notify_select_event(selectsync *sync, uint32 ref);

Sounds good ;-)
 
> with the Be way, the driver had to save individual selectsync/ref for 
> each selected event

Agreed, that's was not so great.

> - with the new API you only have to store one 
> selectsync/ref pair per listener and are allowed to send out 
> notification for everything - only the selected events will trigger an
> notification for the waiting select/poll calls.

Okay, I see. Sounds good, still :-p

> It will still call the driver's select function in the same way as 
> before, but selectsync/ref are guaranteed to be a stable pair (but 
> there could be more than one if the driver wants to support this, e.g.
> different threads selecting on the same socket).

Yep, it's what I added to net_{stack|server}_driver.c, which should support 
fine (read: would awake) multiple threads select()'ing on the same socket.
However, I called the struct storing this "selecter", not "listener".
Oh, well, what's in a name!?

> So in the driver you can fire up all notifications once you have that 
> pair, you don't have to extra check only for the ones selected before 
> (although will still work).

Okay, that's greater.
So, when time will come (not yet, I bet) I guess we could update the 
net_{stack|server}_driver.c to use the OBOS notify_select_event() prototype, 
and write a wrapper around original notify_select_event() for non-OBOS kernell 
targets (R5 and BONE kernels) ?

> That's not only simpler, but also needed because poll() should set 
> POLLERR and POLLHUP even if those events aren't selected.

Where's my poll() man page!?!
Do you mean as drivers won't have to check if the event is monitored or not but 
simply notify, you will catch even errors events, which is needed by these 
POLLERR & POLLHUP?
Just (too?) curious.

-Philippe

Other related posts: