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



David Helder <dhelder@umich.edu> writes:

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

And what do you do of the time for :
- allocating a new process.
- Put it into scheduling table.

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

What is the problem,
do you need to release this library fast because you want
many program to use it ?

or do you want a *good* library which does the right thing
because you involved time in it...

If you don't know how to write an async  gethostbyname(),
either learn / either ask.

What about critical speed application using your library ?


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