Mail Archives: djgpp/1998/04/28/13:40:35
Paul Derbyshire <pderbysh AT usa DOT net> 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
- Raw text -