Problems with a multi-threaded program
From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 11/18/04
- Next message: Joost VandeVondele: "Re: equivalence with dummy arguments"
- Previous message: Jason Nielsen: "g95 for Windows"
- Next in thread: B52B: "Re: Problems with a multi-threaded program"
- Reply: B52B: "Re: Problems with a multi-threaded program"
- Reply: Jugoslav Dujic: "Re: Problems with a multi-threaded program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Nov 2004 10:09:22 +0100
Hello all,
I have severe trouble making an as yet simple multi-threaded program
to work reliably.
The program does the following:
- It starts four threads
- Though ultimately they will have to work together, right now,
they simply run through a few loops, allocating and deallocating
local data, getting a random number and calling a sleep function
(to make sure the threads run simultaneously)
- No global or saved data are used
I have three (four) different platforms at my disposal:
- Sun/Solaris, using an old version of the Sun f90 compiler.
With the option -mt, the program runs smoothly and "correctly"
all the time (at least I have not seen any strange problems
after adding -mt to the compile and link statements)
- RH 7.2 and RH Enterprise Edition, both with Intel Fortran 8.0.
I use the option -reentrancy threaded (otherwise the program
immediately aborts because of recursive I/O).
This version works most of the time, but sometimes a thread
crashes, often in an internal write or a deallocate statement.
- Windows XP with Compaq Visual Fortran 6.6C.
I use a Windows version of the pthreads library that works
well in other contexts.
In this case, the program is very persistent in crashing,
even though I use the multithreaded runtim libraries.
Moreover the random numbers that I get have a tendency to
converge to 1.0
This all leads me to be very wary of multithreading.
Does anyone have suggestions to improve the reliability of
my program? (I could post the source code, but it is some
400 lines of code).
Regards,
Arjen
- Next message: Joost VandeVondele: "Re: equivalence with dummy arguments"
- Previous message: Jason Nielsen: "g95 for Windows"
- Next in thread: B52B: "Re: Problems with a multi-threaded program"
- Reply: B52B: "Re: Problems with a multi-threaded program"
- Reply: Jugoslav Dujic: "Re: Problems with a multi-threaded program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|