<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi,<BR>I'm having problem trying to abort an itk filter which is
multi-threaded (such as itkResampleImageFilter).<BR>I'm using itk (v. 1.8),
vtk (v.4.2) for the rendering, and Qt (v. 3.3.3) for the user interface on Linux
red-hat . In my user interface, I have a dialog window that shows the progress
of the filters and allows the user to stop the process by clicking an "abort"
button.<BR>If I run my program on a single processor machine, everything works
fine, I see the progression of the filter on the progress bar (for this I
set an observer on the ProgressEvent), I can abort the filter (By calling the
AbortGenerateDataOn() member of the filter), and I can re-execute the filter as
I wish. On the other hand, if I run my program on a 2-processor machine,
each time I abort a multi-threaded filter and try to re-execute the filter right
after the abort, a "segmentation fault" is produced.<BR>I think this has to do
with itkProgressReporter. I went to look at the code of itkProgressReporter
and it seems to me, that the abort only affects the threadId 0, which means that
the second thread (and probably all other threads if I had more than 2
processors) is still running after I abort the filter. If I re-execute the
process just after the abort, I get the "segmentation fault". On the other hand,
if I wait long enough before I re-execute the filter so that the second thread
has time to complete, everything works fine.</DIV>
<DIV>I also checked the CPU consumption of my system (using the "top" command)
and my process is still using CPU time after I abort the filter.
If I re-execute the filter before the CPU time of my process is down to 0, the
"segmentation fault" occurs. If I wait until the CPU time is finally down
to 0, then I can re-execute the filter without problem.</DIV>
<DIV>Do I need to do something special in order to be able to abort my
multithreaded filters, or is this a problem that should be handled by
itkProgressReporter?</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I also noticed that filters that use
itkProgressAccumulator (such as itkDiscreteGaussianFilter) are not abortable
(what ever the number of processors). I went to look at the code of
itkProgressAccumulator and I found that there is nothing done in this class (nor
in itkDiscreteGaussianImageFilter) to propagate the AbortGenerateData flag to
the sub-filters of the mini pipe-line.</FONT></DIV>
<DIV><FONT face=Arial size=2>Is this also a problem that I can solve be doing
some special things in order to propagate the AbortGenerateData flag, or is this
a problem that should be handled by itkProgressAccumulator?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for helping me solving these two
problems.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Didier.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Didier A. Rajon<BR>University of
Florida<BR>Department of Neurological Surgery<BR>MBI L2100, PO Box
100265<BR>GAINESVILLE, FL, 32610-0265<BR>Tel: (352) 294
0144</FONT></DIV></BODY></HTML>