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

Re: [Xen-devel] Implementing poll(2) for Mini-OS?



Wei Liu, le Mon 18 Feb 2013 15:40:56 +0000, a écrit :
> I sent a patch to switch cxenstored's event loop from using select to
> using poll several weeks ago,

What is the rationale BTW?  Efficiency?

> My main question is, is it possible to just wrap around select(2) in
> Mini-OS to implement poll(2)? (as shown in the conceptual patch)

Yes, except that there are evil small differences between poll and
select, which we need to take care of.

About the 32 fd limitation, it indeed comes from the days when we always
had a bounded number of things to open.  We need to drop that limitation,
but it should be easy, by turning the `files' array into a reallocable
pointer.  There is just one important thing: the xenbus_event_queue
events field has to be made a pointer to a dynamically-allocated queue,
otherwise it will get moved by the reallocation and things will go wrong
very badly.

> +int poll(struct pollfd pfd[], int nfds, int timeout)
> +{
...
> +
> +    /* Timeout in poll is in second. */
> +    _timeo.tv_sec  = timeout;

FIXME: timeout is in ms, not sec.

> +    _timeo.tv_usec = 0;

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.