Hi,

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?

Matthew

Hoebeke Mark wrote:

Hi,

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,

Mark




_______________________________________________ Biojava-l mailing list - [EMAIL PROTECTED] http://biojava.org/mailman/listinfo/biojava-l

Reply via email to