Welcome to iraf.net Wednesday, May 01 2024 @ 03:48 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 thread safe
   
dbrenner
 10/15/2008 03:11PM (Read 2714 times)  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
Is iraf considered "thread safe". In a script, can it be called multiple times in a C program using threads?
Thanks

 
Profile Email
 Quote
fitz
 10/15/2008 03:11PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
It depends how you call it: If you mean you do a fork()/system() call to something like a #!cl script as a host command, then yes it is safe to do this from threads since each command is a separate instance of the CL. If instead you mean you want to link directly to iraf libraries (e.g. the CVOS interface or imfort), then the answer is no except for purely computational procedures.The problem is that there are several global data structures used in the system that overwrite themselves when using threads (in particular, the file i/o buffering is a problem).-Mike

 
Profile Email
 Quote
dbrenner
 10/15/2008 03:11PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
Thanks. I'm using system () calls and it does seem to work.

 
Profile Email
 Quote
valdes
 10/15/2008 03:11PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
If I understand, you want to run a number of CL scripts at the same time (using separate CL sessions as Mike indicated). We do this with our NOAO parallel and distributed pipelines. Some possible concerns we had to deal with are to make sure the scripts are using separate uparm directories or use the "cache" command if any task is called that updates its parameters. The other problem was with pipes; IRAF uses temporary files for the pipes with autogenerated names. In prior versions of the CL the pipes could get the same names for processes with similar pids. There was a change in the CL to be more clever about this and seems to be quite reliable though the algorithm isn't 100% guaranteed not to conflict. There may be some other subtleties but our pipeline experience has shown it is possible to use IRAF #!cl scripts in a parallel fashion.Yours,
Frank Valdes

 
Profile Email
 Quote
dbrenner
 10/15/2008 03:11PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
Thanks.
I have focal planes that have to be turned into data cubes (x,y, lambda) in the usual learn while you earn format. I discovered that the fitsio library was not thread safe and wanted to know about iraf. I'm still trying to figure the whole thing out.

 
Profile Email
 Quote
   
Content generated in: 0.15 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login