Jeff Squyres wrote on Mon, 19 Feb 2001 17:41:39 EST
>On Mon, 19 Feb 2001, Martin Weinberg wrote:
>
>> I put a global mutex around new/deletes (already had appropriate
>> abstractions for threading and allocation so it was easy) and all
>> efence problems are gone. Multiple thread now passes efence with no
>> problem.
>>
>> I'm also now hopeful that this may be the source of my bizzare memory
>> overruns as well. The code performance does not appear to suffer, so
>> for now I'm going to leave the mutexs in.
>
>Great! Makes your overall code simpler, probably, and if it doesn't cost
>much/anything, it'll make it easier to maintain in the future.
>
>> This also suggests that my new/delete are not thread safe, huh? This
>> is gcc-2.95 compiled with --enable-threads so it is supposed to be
>> thread safe. Not sure what's going on here . . .
>
>AFAIK, gcc can make thread-safe code (I use it for such things). Do you
>know if all your constructors and destructors are thread safe? That can
>cause Badness.
>
Yes, I believe the classes are thread safe; at least some attention
has been paid there, although I spose there could be some subtle
problem. In fact, I put the mutex around the new/deletes in the
member functions that are called by the threaded functions. Suggests
to me that the problem is in libstdc++ . . . we'll see how it goes.
--Martin
_______________________________________________
This list is archived at http://www.lam-mpi.org/MailArchives/lam/
|