[Insight-developers] MultiThreader fixed (?)

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 3 Oct 2001 16:54:32 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C14C4D.9A00A1D0
Content-Type: text/plain;
	charset="iso-8859-1"

Uggh.  I have some data now.  I ran my test 50,000 times and it fails 4 times.
 
It used to fail 1 every 1000 times, so it looks like I fixed something but have yet to irradicate the
problem.

-----Original Message-----
From: Miller, James V (CRD) 
Sent: Wednesday, October 03, 2001 4:30 PM
To: Insight-developers (E-mail)
Subject: [Insight-developers] MultiThreader fixed (?)


I may fixed the multithreader code.
 
It looks like I was calling Delete() on a smart pointer to a mutex lock that protected a flag that
indicated whether a thread was active. The impact of calling Delete() on the smart pointer to the
mutex lock is that the mutex lock ends getting deleted multiple times.  Once by the explicit call to
Delete() and when the smart pointer goes out of scope.  I changed the offending two line of code to
simply set the smart pointer to zero instead.
 
On our dual processor linux machine here, ShrinkImageTest would fail once every 1000 times or so.
After this fix, it did not fail any of the 5000 times that I ran it.  So I am guessing that it is
fixed.
 
However, this is another reason why we should figure out a way to keep people from calling Delete()
on a smart pointer (i.e. ptr->Delete()).
 
Please let me know if you still have problems with the multithreader.


Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Corporate Research & Development
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv@crd.ge.com < mailto:millerjv@crd.ge.com <mailto:millerjv@crd.ge.com> >
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 


 


------_=_NextPart_001_01C14C4D.9A00A1D0
Content-Type: text/html;
	charset="iso-8859-1"

<!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 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2><SPAN class=755274920-03102001>Uggh.&nbsp; I 
have some data now.&nbsp; I ran my test 50,000 times and it fails 4 
times.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN 
class=755274920-03102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=755274920-03102001>It used to fail 1 
every 1000 times, so it looks like I fixed something but have yet to irradicate 
the problem.</SPAN></FONT></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> Miller, James V (CRD) 
  <BR><B>Sent:</B> Wednesday, October 03, 2001 4:30 PM<BR><B>To:</B> 
  Insight-developers (E-mail)<BR><B>Subject:</B> [Insight-developers] 
  MultiThreader fixed (?)<BR><BR></FONT></DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2>I may fixed the multithreader 
  code.</FONT></SPAN></DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2>It looks like I was calling 
  Delete() on a smart pointer to a mutex lock that protected a flag that 
  indicated whether a thread was active. The impact of calling Delete() on the 
  smart pointer to the mutex lock is that the mutex lock ends getting deleted 
  multiple times.&nbsp; Once by the explicit call to Delete() and when the smart 
  pointer goes out of scope.&nbsp; I changed the offending two line of code to 
  simply set the smart pointer to zero instead.</FONT></SPAN></DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2>On our dual processor linux 
  machine here, ShrinkImageTest would fail once every 1000 times or so.&nbsp; 
  After this fix, it did not fail any of the 5000 times that I ran it.&nbsp; So 
  I am guessing that it is fixed.</FONT></SPAN></DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2>However, this is another 
  reason why we should figure out a way to keep people from calling Delete() on 
  a smart pointer (i.e. ptr-&gt;Delete()).</FONT></SPAN></DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=869002420-03102001><FONT size=2>Please let me know if you 
  still have problems with the multithreader.</FONT></SPAN></DIV><BR>
  <P><B><FONT face="Comic Sans MS" color=#000080>Jim Miller</FONT></B> 
  <BR><B><I><FONT face=Arial color=#ff0000 
  size=2>_____________________________________</FONT></I></B><I></I><BR><I></I><I><FONT 
  face=Arial color=#000000 size=1>Visualization &amp; Computer Vision<BR>GE 
  Corporate Research &amp; Development<BR>Bldg. KW, Room C218B<BR>P.O. Box 8, 
  Schenectady NY 12301<BR><BR></FONT><U><FONT face=Arial color=#0000ff 
  size=1>millerjv@crd.ge.com &lt;<A 
  href="mailto:millerjv@crd.ge.com">mailto:millerjv@crd.ge.com</A>&gt;</FONT></U></I><BR><I><FONT 
  face=Arial color=#000000 size=1>(518) 387-4005, Dial Comm: 8*833-4005, 
  </FONT></I><BR><I><FONT face=Arial color=#000000 size=1>Cell: (518) 505-7065, 
  Fax: (518) 387-6981</FONT></I> </P><BR>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C14C4D.9A00A1D0--