<!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.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi again,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've done the threading now like it is done in the
ImageSource class.</FONT></DIV>
<DIV><FONT face=Arial size=2>But what I observe when I try to execute it, is not
what should happen.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I expected to see two different processes in the
Task Manager (Win XP),</FONT></DIV>
<DIV><FONT face=Arial size=2>when I
call SingleMethodExecute().</FONT></DIV>
<DIV><FONT face=Arial size=2>But this is not the case. </FONT><FONT face=Arial
size=2>I actually see two tasks of the programm, but only</FONT></DIV>
<DIV><FONT face=Arial size=2>a single process. I expected to have two processes,
which run in parallel,</FONT></DIV>
<DIV><FONT face=Arial size=2>one doing registration (the one which is newly
created) and the original one,</FONT></DIV>
<DIV><FONT face=Arial size=2>which is doing GUI staff
(FLTK).</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm doing this to be able to stop the registration
process manually by observing the </FONT></DIV>
<DIV><FONT face=Arial size=2>optimizer.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Markus</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></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=millerjv@crd.ge.com href="mailto:millerjv@crd.ge.com">Miller, James V
(GE, Research)</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=m.weigert@fz-juelich.de
href="mailto:m.weigert@fz-juelich.de">Markus Weigert</A> ; <A
title=insight-users@itk.org
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, June 07, 2006 10:41
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Insight-users] ITK Threads
with memberfunctions</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff
size=2>Marcus,</FONT></SPAN></DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff size=2>The
pattern I use to have the multithreader call a static function (or a standard
C function) and pass the object as part of the clientdata. The static
method, then casts the clientdata back to the object type and calls the member
function that I wanted to call.</FONT></SPAN></DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff size=2>This
is how the multithreaded filters are implemented. Take a look at
ImageSource::GenerateData() and
ImageSource::ThreaderCallback().</FONT></SPAN></DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=660033820-07062006><FONT face=Arial color=#0000ff
size=2>Jim</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
insight-users-bounces+millerjv=crd.ge.com@itk.org
[mailto:insight-users-bounces+millerjv=crd.ge.com@itk.org]<B>On Behalf Of
</B>Markus Weigert<BR><B>Sent:</B> Wednesday, June 07, 2006 2:38
PM<BR><B>To:</B> insight-users@itk.org<BR><B>Subject:</B> [Insight-users]
ITK Threads with memberfunctions<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Dear all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I would like to make a programm, at which I'm
currenty </FONT></DIV>
<DIV><FONT face=Arial size=2>working, multithreaded.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>As far as I know, there is a class called
itkMultiThreader which</FONT></DIV>
<DIV><FONT face=Arial size=2>provides this functionality.</FONT></DIV>
<DIV><FONT face=Arial size=2>My question is, if this class can also be used
to create a thread</FONT></DIV>
<DIV><FONT face=Arial size=2>for a memberfunction of an object, because I
always receive compiler</FONT></DIV>
<DIV><FONT face=Arial size=2>complaints from VC6 on std_call problems
when I call SetSingleMethod().</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>As far as I know, </FONT><FONT face=Arial
size=2>for example posix threads only work with C-functions.</FONT></DIV>
<DIV><FONT face=Arial size=2>So, is this also true for the multithreader or
may the problem be different?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I think that for example, the threads from
Boost library can deal with member functions,</FONT></DIV>
<DIV><FONT face=Arial size=2>but I would not like to use a large library
only for one small feature.</FONT></DIV>
<DIV><FONT face=Arial size=2>Can you please give me a hint?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Markus</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>PS: declaring the function as static is not
possible, </FONT></DIV>
<DIV><FONT face=Arial size=2>because it accesses non-static
members.</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>