forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Issues with shared memory / Extended ALLOCATE statement
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8283
Location: Salford, UK

PostPosted: Tue May 24, 2011 6:04 pm    Post subject: Reply with quote

Yes your summary is about right but until I investigate the extent of the problem remains unknown.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8283
Location: Salford, UK

PostPosted: Wed Aug 03, 2011 8:52 am    Post subject: Reply with quote

The following program illustrates the fact that you can have shared memory between two instances of the same executable.

First make sure that the file stat.dat is erased and then run the executable in one DOS box. Now run the same exe in a another DOS box.

Code:
include <windows.ins>
character,pointer::msg*80
logical fexists@
integer ercode
  allocate(msg, SHARENAME="MyMemory")
  if(.NOT. fexists@("stat.dat",ercode)) then
    OPEN(10,FILE="stat.dat")
    CLOSE(10)
    print*, "Type a message to send. Do not use spaces..."
    read*, msg
    call SIGNAL_SEMAPHORE@("MySemaphore")
    deallocate(msg)
  else
    print*, "Waiting for message..."
    call WAIT_ON_SEMAPHORE@("MySemaphore")
    print*, msg(1:len_trim(msg))
  endif     
end
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group