[gt-users] gt python with (multi)processing
Gordon Gremme
gremme at gmail.com
Thu Jan 21 12:58:43 CET 2010
>> - If I didn't miss something, everything with a global state in
>> libgenometools should be MT-safe now (file allocator, symbol and
>> random number generator module). The memory allocator is MT-safe, if
>> the memory bookkeeping is not used. Making the memory bookkeeping
>> MT-safe is not possible without a major redesign which I consider
>> low-priority.
>
> Agreed. Making the reference counting thread-safe is another major
> issue, IMHO. What do you think?
I agree.
>> - Testing is even more important for multithreaded-code! I thought
>> twice the memory allocator with bookkeeping is now MT-safe before I
>> realized it is not possible with the current design. As a testing
>> strategy, I added a -j development option to the gt binary which can
>> then be used in the unit tests to start parallel threads to stress
>> test the corresponding data structure in parallel (gt_multithread()
>> starts -j many threads, see core/symbol.c for an example).
>
> Very useful. Do you think we should add a multithreading test case to
> every unit test when the class in question has been modified for
> thread-safety?
That would be very useful. With gt_multithread() it can be written in
a way that doesn't duplicate code.
Gordon
More information about the gt-users
mailing list