Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Paul Derbyshire , djgpp AT delorie DOT com Date: Tue, 28 Apr 1998 14:44:00 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Some questions about operator new. In-reply-to: <354560B9.BF464CF@usa.net> Precedence: bulk Paul Derbyshire wrote: > 1. Is DJGPP's new thread-safe? Or would two threads doing allocation or > deletions simultaneously corrupt the arena? new calls to malloc and the malloc in 2.01 isn't thread-safe at all. I didn't saw the code of the malloc in 2.02, but I think isn't thread-safe. Even more: How can you do a thread-safe malloc if the threads library isn't related to libc? I think you must redefine new to call malloc but enclosing it with a lock/unclock call to the threads systems. > 2. In 2.8.0 and later does new throw bad_alloc, or does it abort? > Is there a way to make it throw bad_alloc? Where the heck is > bad_alloc? I don't know about 2.8.x but in 2.7.x you can define a function to be called when new fails. If you need more info just ask me (it works in 2.8.x too). SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013