From owner-freebsd-threads@FreeBSD.ORG Thu Jan 26 20:43:10 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EB7516A420; Thu, 26 Jan 2006 20:43:10 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1D5343D45; Thu, 26 Jan 2006 20:43:09 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 26 Jan 2006 12:43:09 -0800 Message-ID: <43D9345D.9010205@elischer.org> Date: Thu, 26 Jan 2006 12:43:09 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jose-Marcio.Martins@ensmp.fr References: <43D74F91.2090009@ensmp.fr> <43D7C786.1090803@elischer.org> <43D7E45E.8070103@ensmp.fr> <43D802DF.9040003@elischer.org> <43D88E69.1020102@ensmp.fr> <43D922D5.1000307@elischer.org> <43D9324A.40905@ensmp.fr> In-Reply-To: <43D9324A.40905@ensmp.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-threads@freebsd.org Subject: Re: Changes from 5.2.1 to 5.3 (theads / signal handling) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2006 20:43:10 -0000 Jose Marcio Martins da Cruz wrote: > Julian Elischer wrote: > >> Jose Marcio Martins da Cruz wrote: > > >>> So, if I understood, the better I can do is, instead of letting the >>> child follow >>> a different path after the fork, he shall better do an exec of >>> another thing and >>> start a clean process... >>> >>> >>> >> >> often what is done is to exec itself again with a different argument >> to make it know it is the child. >> >> why do you need to fork? why not just use more threads? > > > This is a security issue. The application is a sendmail mail filter. > For many reasons the filter may die : an attack may succeed or there > may be a bug. > > The father is a supervisor only. He launches the child which is the > real filter. From time to time, the father checks if the filter is > alive and running (not blocked) - this is done by a non blocking wait > and a pipe between the father and the child. If there is a problem > with the child (died of blocked), the father does some clean up and > launches a fresh child. sounds like the parent need not be threaded yet. > > I use a different process instead of more threads because a problem > with a thread can compromise all the process. > > This application runs fine under Solaris (four years long now). Each implementation has different side-effects On FreeBSD 6, try the libthr() threading library. > > Well, I definitely shall try to change this architecture, at least for > FreeBSD and maybe Linux too. > >> >> I can suggest the threads programming book >> Programming with POSIX Threads >> by >> David R. Butenhof > > > Thanks, I have it. I read it long time ago... > > >