[Insight-developers] Cygwin and Multiple processors

Miller, James V (CRD) millerjv@crd.ge.com
Fri, 27 Jul 2001 20:50:53 -0400


I did a little investigation on the problem with cygwin and multiple processor machines.  My original
thought was that itk::MultiThreader did not work under cygwin.  However, on a single processor
machine I added a line to one of the tests that is failing on multiple processor systems.

itk::MultiThreader::SetGlobalDefaultNumberOfThreads(4);

Running the modified test, 4 threads are created and the test passed.  So the problem in creating and
destroying threads.  

Rather, it appears as though the problem is in running threads on multiple processors. This is
something that I will not be able to check into further until I get back from vacation.

The documentation on cygwin and pthreads is rather spotty.  Most pages found by google simply state
that pthread support is experimental.

Lydia, if you are looking for something to try: itkMultiThreader.cxx has a number of calls to
pthread_attr_setscope().  But these calls are all bypassed (ifdef'd out) if we are running under
Win32.  You might want to enable these calls (there are several of them in the MultiThreader.cxx
code).  Perhaps we need them for pthread on cygwin but not for pthreads on standard win32.

I'll be back in the office a week from Monday (maybe Tuesday, maybe Wednesday).

Jim