xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Li <dev@zheng.li>
To: David Scott <dave.scott@citrix.com>
Cc: Ian Jackson <Ian.Jackson@citrix.com>,
	Joe Jin <joe.jin@oracle.com>,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	Luonengjun <luonengjun@huawei.com>,
	Fanhenglong <fanhenglong@huawei.com>,
	"Liuqiming (John)" <john.liuqiming@huawei.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 1/8] oxenstored: add a poll-based select mechanism
Date: Tue, 16 Sep 2014 14:00:46 +0100	[thread overview]
Message-ID: <5418347E.9010000@zheng.li> (raw)
In-Reply-To: <AF17C949-209B-40F0-8236-7C38EC4FDDBF@citrix.com>

On 16/09/2014 10:01, David Scott wrote:
>> +type event = {
>> +	mutable read: bool;
>> +	mutable write: bool;
>> +	mutable except: bool;
>> +}
>
> If I understand correctly this is a representation of the POLL{IN,OUT,PRI} bitmap in the C stubs — might be worth a short comment (to help me remember in future)

Yes, it also corresponds to the read/write/except fd_set as in the existing Unix.select.

It's currently an internal type and not exposed by the module interface, but I agree a comment would be useful to developers.  I will add the in v2.

>> +	let a = Array.make (Hashtbl.length h) (Unix.stdin, init_event ()) in
>
> Might be worth a comment to say that Unix.stdin is a dummy value, since all entries in the array are overwritten below.
>

Will do in v2.

>> +	if (rc < 0) uerror("select", Nothing);
>
> Perhaps the error string should be “poll” so it would be obvious from the Unix_error which implementation failed?
>

Initially it was implemented as a faithful in-place substitution of Unix.select (i.e. same type signature, same semantics, except the 1024 fd limitation), as such we even kept the exception message exactly the same.

Now think twice, I agree with you it's better to be different, especially if we consider to move to a type signature/implementation more natural to poll in the future version (for some performance advantages).

Cheers,
Zheng

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

  reply	other threads:[~2014-09-16 13:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 22:39 Some oxenstored improvements Zheng Li
2014-09-15 22:39 ` [PATCH 1/8] oxenstored: add a poll-based select mechanism Zheng Li
2014-09-16  9:01   ` David Scott
2014-09-16 13:00     ` Zheng Li [this message]
2014-09-15 22:39 ` [PATCH 2/8] oxenstored: add facilities to raise the max open fds uplimit Zheng Li
2014-09-16  9:05   ` Dave Scott
2014-09-16  9:38   ` David Vrabel
2014-09-16 13:05     ` Zheng Li
2014-09-15 22:39 ` [PATCH 3/8] oxenstored: add a --use-select command line flag Zheng Li
2014-09-15 22:39 ` [PATCH 4/8] oxenstored: catch the error when a connection is already deleted Zheng Li
2014-09-16  9:08   ` Dave Scott
2014-09-15 22:39 ` [PATCH 5/8] oxenstored: use hash table to store socket connections Zheng Li
2014-09-15 22:39 ` [PATCH 6/8] oxenstored: enable domain connection indexing based on eventchn port Zheng Li
2014-09-16  9:16   ` Dave Scott
2014-09-16 13:13     ` Zheng Li
2014-09-15 22:39 ` [PATCH 7/8] oxenstored: only process domain connections that notify us by events Zheng Li
2014-09-16  9:19   ` Dave Scott
2014-09-16 13:34     ` Zheng Li
2014-09-15 22:39 ` [PATCH 8/8] oxenstored: fine tunning the recognition of domain connections with queued input/output Zheng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5418347E.9010000@zheng.li \
    --to=dev@zheng.li \
    --cc=Ian.Jackson@citrix.com \
    --cc=dave.scott@citrix.com \
    --cc=fanhenglong@huawei.com \
    --cc=joe.jin@oracle.com \
    --cc=john.liuqiming@huawei.com \
    --cc=luonengjun@huawei.com \
    --cc=mcgrof@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).