uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timo Boehme <timo.boe...@ontochem.com>
Subject Daemon threads prevents CPE exit
Date Thu, 21 Oct 2010 08:29:49 GMT
Hi,

before I might create a bug report I would like to ask the list if the 
behavior of the CPM engine in respect to daemon threads is intended or not.

The problem:
Within an AE I have created daemon threads for processing some tasks. 
The threads are within a singleton class with a static variable 
containing the single instance. The threads are explicitly marked as 
daemon threads in order to not wait for them after processing ends.
After processing of all documents finished, the CPE calls 
CollectionProcessComplete but the application does not exit.
The reason: in org.apache.uima.collection.impl.cpm.engine.CPMEngine a 
threadGroupDestroyer thread is created (line 2522) which waits for 
threads to die. Since it does not check for daemon threads it counts 
them as normal threads to wait for and thus it waits forever.

My workaround was to specify another ThreadGroup outside CPMThreadGroup. 
However this is only possible as long as I have the source code for the 
libraries in use.

In general I would think that UIMA should really test for daemon threads 
(even more as the used group.activeCount() should only be used for 
information purposes - as the javadoc states).

Any comments?

Thanks,
Timo

-- 

  Timo Boehme
  OntoChem GmbH
  H.-Damerow-Str. 4
  06120 Halle/Saale
  T: +49 345 4780472
  F: +49 345 4780471
  timo.boehme@ontochem.com

_____________________________________________________________________

  OntoChem GmbH
  Geschäftsführer: Dr. Lutz Weber
  Sitz: Halle / Saale
  Registergericht: Stendal
  Registernummer: HRB 215461
_____________________________________________________________________


Mime
View raw message