On Thu, Jul 17, 2008 at 1:33 AM, Paul McCullagh
<[EMAIL PROTECTED]> wrote:
> Hi Brian and Mark,
>
> On Jul 16, 2008, at 1:03 AM, Brian Aker wrote:
>
>> So to me these need to be set:
>> error= setsockopt(ptr->fd, SOL_SOCKET, SO_LINGER,
>> &linger, (socklen_t)sizeof(struct linger));
>> error= setsockopt(ptr->fd, SOL_SOCKET, SO_SNDTIMEO,
>> &waittime, (socklen_t)sizeof(struct timeval));
>> error= setsockopt(ptr->fd, SOL_SOCKET, SO_RCVTIMEO,
>> &waittime, (socklen_t)sizeof(struct timeval));
>> (void)fcntl(ptr->fd, F_SETFL, flags | O_NONBLOCK);
>
> What I don't quite understand is, why use non-blocking I/O?
I agree that for my branch there is no reason to use non-blocking IO.
read/write with a timeout works. drizzle has different goals.
>
> This would be like polling the connection. But after setting a timeout you
> shouldn't need to poll.
>
> Another thing:
>
> Have you considered using c10k and a pool of threads?
>
> (although a THD would still be associated with a particular connection)
>
> I have heard of patches for MySQL that do this, but supporting both methods
> just makes things complex.
>
> So what is the best method in your opinion?
The thread pool in MySQL 6.1 uses libevent. We have backported that to
our 5.0 branch. But using only non-blocking IO might require some
surgery if this is done to keep a thread from getting blocked on net
IO when it could be running a query.
* what happens when the server reads part of a packet and no more data
is ready, does it keep on trying or buffer the partial packet and move
on. If MySQL were written in Scheme then continuations would make
such a control flow change possible.
* support is still needed for net_{read,write}_timeout
>
> Regards,
>
> Paul
>
>
--
Mark Callaghan
[EMAIL PROTECTED]
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp