From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <438E0EDD.7010009@lanl.gov> Date: Wed, 30 Nov 2005 13:43:09 -0700 From: Ronald G Minnich User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Threadcreate() failure value? References: <438E048B.50808@lanl.gov> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: b46db36a-ead0-11e9-9d60-3106f5b1d025 Russ Cox wrote: >>what if your create failed due to some other process having the process >>leak, and you'd like your process, which has done nothing wrong, to get >>out of the mess cleanly? > > > Then you will need to change the thread library and then > edit all the programs that use it to check the return values > on threadcreate and proccreate. or .... provide versions of the functions that return on error, for those cases where they are needed. And then have the "normal" function call this function, and on failure, act as it acts now (i.e. exit)? I realize that just blowing the process away on this type of failure is a very reasonable thing to do, but in a very few cases here, we need to recover and stumble along in the case of such failure, and try to at least get to a sane state before dying. ron