From: Mark D. <ma...@ki...> - 2006-08-21 05:29:17
|
On Mon, 21 Aug 2006 00:26:52 -0500, Gary Kramlich wrote > Mark Doliner wrote: > > People on gaim-commits may already be familiar with this... > > > > Previously there were three different methods used to resolve IP addresses in > > Gaim. We chose a different method at compile time based on your OS. They all > > used either getaddrinfo() or gethostbyname(). The differences lie in how they > > achieved non-blockingness. > > > > In Unix-land we forked a process to do the lookup, then waited for the process > > to send us the results. In Windows-land we spawned a thread and did the > > lookup there. In anything else we used a very bland implementation which > > blocked the UI. > > > > It seemed dumb to me to have three implementations of the same thing, so I got > > rid of the Unix one and the other one and now we're using only the > > thread-based lookup. > > > > Ethan didn't like this (I think because it uses threads?), but his reasons > > didn't really convince me. How do other people feel? It's pretty easy to > > revert my change and go back to having lots of crazy and confusing code, if > > people want. > > > > -Mark > > Why do we need a thread? Can't we use a watcher or listener in our main > loop? We use either getaddrinfo() or gethostbyname(), and they are both blocking. -Mark |