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



On 6 Jan 2000, Vandoorselaere Yoann wrote:
> David Helder <dhelder@umich.edu> writes:
> > 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 ????

Linux (and most good OSes) will only copy the parent's process table and
then copy pages on _write_ only.  So, the entire process isn't copied.

I don't think it will be too slow.  I'll try it out and see how it works.

> 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.

gethostbyname is pretty complex.  If adns were under LGPL, then I'd
consider using that.

David


-- 
      __          _    __ 
  ___/ /__ __  __(_)__/ /  David Helder - University of Michigan
 / _  / _ `/ |/ / / _  /   dhelder@umich.edu
 |_,_/|_,_/|___/_/|_,_/    http://www.eecs.umich.edu/~dhelder



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