fork, select & socket performance ?

Ragnar Hojland Espinosa ragnar at
Tue Feb 18 15:32:31 UTC 2003

Another basic question I'd love some orientation with:

I have a little question on fork permormance.  In my little TCP/IP program I
plan to have, roughly:

     - listener process
       put new client socket in a shared queue       
     - other process
       read-block on listener shared queue
       fork a reader and a writer for each client
Given I can have over 500 clients at a time, with bursts of about 60 new
clients / second , will all this forking be ok?  Or should I build a, say,
100 process pool and reuse them?  Or is there a better way to do it?

Another thing, what class should I look at if I want to do something like
select, either C or even perlish?

	$read_fds = IO::Select->new();
	$read_fds->add ($socket);		
	my @read_set = $read_fds->can_read;
	foreach my $read_socket (@read_set) {
		# ...

Ragnar Hojland - Project Manager
Linalco "Especialistas Linux y en Software Libre" Tel: +34-91-5970074 Fax: +34-91-5970083

More information about the Squeak-dev mailing list