Re: Event loop



On Mon, 13 Nov 2000, Henri Torgemane wrote:
My question is: Is there any drawback with that approach? Would I be better
off forking or spawning threads to deal with pieces of the network logic
separately (which is sort of the "traditional" unix server design) ?
I'm under the impression using Glib that way is efficient since it doesn't
have any of the overhead threading of forking would incur..
Everything gets processed sequentially, but it's exactly what would happen if
things were threaded anyway (assuming only one processor in the box)

Depends.  If you only have one processor, often asyncronous is faster.  
Most apps don't need super high performance, so it often doesn't matter
how you implement it.


On the other side, Glib was written to be used with a graphic toolkit, not
with a network intensive program, and while its implementation seems to be
pretty efficient, one can wonder if it's the right tool for the job. Also I
haven't really heard of any other server out there based on Glib..

See GNet for nice wrappers: http://www.eecs.umich.edu/~dhelder/misc/gnet

Or, use the usual BSD sockets API and use g_io_channel_new_unix().

David


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





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