Re: [f2py] threading with f2py

Kevin Mitchell <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
> could you say specifically which module you are talking about, and maybe a code snippet?

from multiprocessing import Process
class testit(Process):

def __init__(self, r,x):
      Thread.__init__(self)

self.x = x.copy()
self.r = r.copy()

def run (self):
  print "thread is running"
  self.r = mycode( self.x)


i.e., the api is exactly the same for the most basic case.



> could you offer an example.
subroutine testf(r,x,n)
!f2py threadsafe
  implicit none
 . . .
end

That said I have never managed to understand what that does exactly.

Finally only Fortan 77 is non-reentrant. I strongly suggest you just
use a f90 compiler (such as gfortran) which will solve the reentrant
problem. You won't even have to actually learn any f90 since it should
be backward compatible.

Kevin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.