[Biojava-l] Parsing GenBank files in Threads

Matthew Pocock matthew_pocock at yahoo.co.uk
Thu Apr 1 14:31:56 EST 2004


The biojava policy on synchronization is that we try to make things safe 
if possible, but expect the user to synchronize sanely. Unfortunately, 
this is usually not documented anywhere. I could not guarantee that 
GenbankFormat is threadsafe - it would be sensible for it to be, but the 
particular implementation may not be. To help us track this, could you 
include some example stack traces of eratic behavior?


Hoebeke Mark wrote:

>I was wondering if Sequence objects are thread-safe.
>In a pipeline I am developing I parse a set of GenBank flat files in
>several simultaneously executing threads (one file per thread,
>obviously), to feed them in a database.
>On execution I get erratic ArrayOutOfBoundsExceptions when invoking the
>SimpleSequence.getString() method. The indices in question are mostly
>negative. The SimpleSequence instance is created trough a
>SequenceIterator obtained  with SeqIOTools.readGenbank().
>When I prefix the method making this call with 'static synchronized' the
>errors disappear.
>I leafed through 6 months worth of mail archives looking for clues, to
>no avail.
>My guess is that there could be something odd happening in the
>SeqIOTools.readGenbank() method, which is declared as a static method.
>Any help would be greatly appreciated.
>Thanks in advance,

More information about the Biojava-l mailing list