From owner-freebsd-questions Sat Nov 2 18:57:51 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6B9E37B401 for ; Sat, 2 Nov 2002 18:57:50 -0800 (PST) Received: from web40707.mail.yahoo.com (web40707.mail.yahoo.com [66.218.78.164]) by mx1.FreeBSD.org (Postfix) with SMTP id 5A71543E6E for ; Sat, 2 Nov 2002 18:57:50 -0800 (PST) (envelope-from alirezamahini@yahoo.com) Message-ID: <20021103025750.99272.qmail@web40707.mail.yahoo.com> Received: from [81.12.16.1] by web40707.mail.yahoo.com via HTTP; Sat, 02 Nov 2002 18:57:50 PST Date: Sat, 2 Nov 2002 18:57:50 -0800 (PST) From: alireza mahini Subject: how can i use two child for sending and receiving data with minimum delay? To: questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello I am Alireza .I develop a program for sending and receiving data via two child as below: main(){//parent if(!fork()){ sendto(sd1,...); recvfrom(rd1,...); exit(0); } if(!fork()){ sendto(sd2,...); recvfrom(rd2,...); exit(0); } while(waitpid(-1,NULL,WUNTRACED));//wait for childs .... } In above solution time of waiting for childs is about milisecond but when i wrote program without any child (as below),program execution time is about microsecond. main(){ sendto(sd1,...); recvfrom(rd1,...); exit(0); sendto(sd2,...); recvfrom(rd2,...); } Note :sd1,rd1,sd2,rd2 are DGRAM sockets; __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message