[BioRuby] Thread-safety of alignment

Andrew Grimm andrew.j.grimm at gmail.com
Tue Jan 26 12:12:35 UTC 2010


Hi Naohisa Goto,

I tried creating a new factory in each thread, but I sometimes (but
not always) have errors.

Is the code in http://github.com/agrimm/bioruby-alignment-threading-replication/blob/master/test/test_multithreaded_alignment.rb
correct? Does it cause problems for anyone else?

Some of the errors I get include the ones seen at http://gist.github.com/286775

It's possible that the issues are caused by problems in tempfile
itself (which may have been fixed in August 2009 according to the
changelog).

Thanks,

Andrew

On Thu, Jan 21, 2010 at 12:50 AM, Naohisa GOTO
<ngoto at gen-info.osaka-u.ac.jp> wrote:
> Hi,
>
> On Wed, 20 Jan 2010 23:09:19 +1100
> Andrew Grimm <andrew.j.grimm at gmail.com> wrote:
>
>> Is alignment intended to be thread-safe in bioruby? If so, should I
>> use the same alignment factory between threads, or a separate one in
>> each thread?
>
> It is not confirmed to be thread-safe, so it is safe to use
> separate one in each thread.
>
> Currently, in BioRuby, manipulating the same object from different
> threads is not intended. When manipulating the same object from
> different threads is needed, using mutex is recommended.
>
> For library developers, it is encouraged to write thread-safe
> code if possible, but not mandatory.
>
> Naohisa Goto
> ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
>
>>
>> Andrew
>> _______________________________________________
>> BioRuby Project - http://www.bioruby.org/
>> BioRuby mailing list
>> BioRuby at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioruby
>
>



More information about the BioRuby mailing list