- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a fortran program are there any extensions (or even possible with Fortran standard) that can pause a program during execution and wait for a signal from an external source to resume execution.
My assumption is that the EXECUTE_COMMAND_LINE could work for running a separate program, but I would ideally like to have two separate programs that run in parallel and pause to communicate with each other when there is a needed information exchange. I could do binary files that one program waits for the other to update, but is there any way to send an electronic signal or even pass arrays within memory (RAM) or does that only work with subordinate programs compiled as dll?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One main problem with the infinite loop that checks a file is that it would be using excessive CPU time while waiting. What would be even better if there was some way for the program to sleep/pause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Windows API has many such synchronization features. Events are probably most relevant to your need. The event would be created, one program would do WaitForSingleObject on the event and the other program would signal the event when ready. There are also mutexes. You might look at our DLL\DLL_Shared_Data sample for a use of mutexes used to synchronize two programs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK great, where are those examples? Do the programs have to be DLLs or can they be stand alone executables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are in the compiler folder under Samples\en_US\Fortran. Look in DLL.zip for this one. It has two programs that share data through a DLL.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page