On Tue, 04 Mar 2008, nash wrote:
> On Mon, 2008-03-03 at 20:05 +1300, Lee Begg wrote:
> > On Mon, 03 Mar 2008, nash wrote:
> > > The documentation to do that in mysql & postgresql is part of the
> > > standard examples.  Essentially when you connect you ask for the FD,
> > > then use the async call all the time.
> >
> > I had a look through the MySQL docs, and found the mutliple
> > query/multiple results methods, but no file descriptor. Do you have a URL
> > for the example/documentation?
>
> No I don't actually.  I just checked the code that did it, and it uses a
> thread and the threaded api, which is ugly.  The comments in that code
> indicate the author thinks it sucks too, and suggests to use a real
> database...

I've been hearing that a lot....

> I'll have another look later, and see if I can find the magic.

Cool, thanks.

> > A URL for async PostgreSQL would be useful too.
>
> PostgreSQL is easy:
>
> http://www.postgresql.org/docs/8.1/static/libpq-async.html
>
> PQsocket is the magic one, then just select/poll (or use
> ecore_fd_handler_add ;-)

Ahh, excellent. It looks very similar to what I had hoped for.

As for the event/select loop, I haven't decided which (if any) I will use. It 
certainly will not change before 0.5.0.

> > > And performance wise, it's the way to do it... much quicker.
> >
> > That's what I thought. I would take quite a bit to rearrange the
> > processing in tpserver-cpp to make it work, but hopefully it is useful.
>
> Catch is, will the extra cost of keeping messages in order kill the
> gain?

I should do. Should be able to process other player's requests while waiting 
for the DB to return. It certainly will be more complex though.

>       Regards,
>       nash

Later
Lee

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to