Re: kevent and wait time?
Re: kevent and wait time?
- Subject: Re: kevent and wait time?
- From: email@hidden
- Date: Tue, 11 Apr 2006 03:50:03 -0700
Dave,
1) Add more than one event at a time.
2) Get more than one event at a time.
3) Add and get events in the same call to kevent().
Those cases, while powerful, are also riddled with complications
of use that are far beyond the scope of this e-mail thread. Trust
me, you can write very efficient/fast code without using those
cases.
I only add one event at a time, though I do currently get more
than 1.
Oops -- turns out I was actually getting more than 1 event at a time,
as well as adding all of the events at the same time as getting the
initial set. I've changed my code to only get 1 kevent per call, as
well as to add them separately. I'm also limiting the connections
i'm testing with to 1000 (a Perl script running on a separate box
running Gentoo Linux is making the socket connections to the kqueue-
based test server). I then wrote a very simple bash script to run
both of them (C++ server and Perl client) forever in a loop, the idea
being to see if it ever brings up the spinning ball.
I really don't recommend that for any non-trivial use of kqueues.
There are difficult state engine semantics to get right when you do
so.
So far (about 4 hours) it hasn't, when my earlier code would often
make the spinning ball appear across the whole system, though that
was with 5000+ connections. However, i'm processing many less events
per second, by an order of magnitude. Since the idea is to see how
far it can go (to see if a kqueue-based server works well for OSX in
C10K -- and higher -- scenarios), I don't mind going through the pain
of handling the various states -- I really do want to understand this
API really well, even the painful / difficult parts. I've downloaded
the xnu for 10.4.6, and in the absence of a kqueue reference, i'll
study that ... but any RFCs or anything that describe the states and
how to handle them would be cool.
I've also found the libEvent library, whose description indicates it
will do some of this for me. I'll see how a libEvent-based server
(using kqueues on OSX) compares to my raw one.
http://monkey.org/~provos/libevent/
Regards,
John, who sincerey appreciates the help
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden