From owner-freebsd-hackers Fri Jan 3 14: 1: 2 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50E5337B401 for ; Fri, 3 Jan 2003 14:01:01 -0800 (PST) Received: from mel-rto3.wanadoo.fr (smtp-out-3.wanadoo.fr [193.252.19.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C75543E4A for ; Fri, 3 Jan 2003 14:01:00 -0800 (PST) (envelope-from rmkml@wanadoo.fr) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto3.wanadoo.fr (6.7.015) id 3E0C33B5003508E3 for freebsd-hackers@FreeBSD.ORG; Fri, 3 Jan 2003 23:00:59 +0100 Received: from wanadoo.fr (217.128.40.125) by mel-rta7.wanadoo.fr (6.7.015) id 3E075B1B0040AB50 for freebsd-hackers@FreeBSD.ORG; Fri, 3 Jan 2003 23:00:59 +0100 Message-ID: <3E1608CB.E8BCCA90@wanadoo.fr> Date: Fri, 03 Jan 2003 23:03:55 +0100 From: rmkml X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.21-pre2 i686) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG Subject: vfork/execve programming trouble Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I've a problem with a C program: This is a multithread client/server; there are 3 mains threads functions: - one to receive signals (pthread_setmask() SIGQUIT, HUP, ALRM, sigwait()...) - one to proceed tasks (pthread_cond_wait in an infinite loop) - one to accept tcp cnx (listen, accept, fgets...) a client can connect to the server (via a tcp port) and send cmd; each new cnx creates a new thread. Some commands generate something like a queue of tasks. Theses tasks are proceeded by the action thread: the client thread sends a pthread_cond_broadcast to the action thread, so it begins to proceed the queue. The action thread has to launch external progs. this is done by vfork and execve. so it is the action thread which vfork and execve. problem: each time the external cmd is called the program freezes. it seems that prog unfreeze only when the external cmd is over. I try to play with sigaction and SA_NOCLDWAIT too but without any results. Any idea and suggestion are welcome Regards. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message