Re: Sort-of Announce: Gnet, a network library



David Helder <dhelder@umich.edu> writes:

> On Thu, 6 Jan 2000, Roberto Zunino wrote:
> > If you want you could look at the features of my gnome-socket that are
> > missing in Gnet and (possibly) incorporate them in it if it's worth the
> > work.
> > Basically, it's asynchronous dns lookup (via the adns library) and a
> > slightly higher level async network IO (i.e. the library calls
> > g_io_add_watch for you when it's necessary).
> 
> Yes, async DNS is a weakness in Gnet.  I've glanced at adns.  The license
> is a problem.  If I were to implement it (and I probably will), I'd
> probably just fork and call gethostbyname.  This probably costs a bit more

Ummm calling fork() to do a gethostbyname instead of rewwriting
gethostbyname to operate asynchronously is dirty and slow...

And it is still worse if this is in a library and that this library
is used in some *big* program...

Do you remember that fork() does a copy of the *entire* calling process ?
How can you think of doing such a thing that way ????


> than implementing gethostbyname from scratch as adns does, but, hey, at
> least I don't have to implement gethostbyname from scratch.
> 
> I like your gnome_socket_connect.  In Gnet you would create an InetAddr,
> create a TcpSocket, get the GIOChannel for the TcpSocket, and then set up
> the callback.  I may add a similar function that combines these steps as
> you do.
> 

You have the following solution :
- rewrite gethostbyname and make it asynchronous : clean way.
- use one posix thread for each gethostbyname    : dirty. 
- use fork for each gethostbyname                : dirty and slow.


see you

-- 
                   -- Yoann,  http://www.security-addict.org
     It is well known that M$ products don't call free() after a malloc().
     The Unix community wish them good luck for their future developments.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]