AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exchanging Variables in Network/Sending Events

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Tekl



Joined: 24 Sep 2004
Posts: 813
Location: Germany

PostPosted: Wed Oct 13, 2004 11:16 pm    Post subject: Exchanging Variables in Network/Sending Events Reply with quote

Hi,

I don't know if it's possible. But I'm looking for a solution to let two AHK-scripts with each other. The script are on different machines in a LAN. At this time I use a workaround with the registry of the server, but it could be cool to share variables over the network or to send events to other computers. For example I want to monitor a program on another computer. If the program on the other computer crashes I want a message on the computer I'm sitting in front of.

Tekl
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Oct 14, 2004 2:55 am    Post subject: Reply with quote

It's a good idea, though somewhat low priority for now due to the expected complications involved with network communications between scripts. Normally, I use mapped drives and create files locally or remotely to communicate with another script; this is probably less elegant than your method of using the registry.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Tekl



Joined: 24 Sep 2004
Posts: 813
Location: Germany

PostPosted: Thu Oct 14, 2004 10:18 am    Post subject: Reply with quote

Hi Chris,

I also tried it with files, but that slows down the pc to much when it will be done every second. I submit a percentag-value to another pc.

Tekl
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Oct 14, 2004 12:41 pm    Post subject: Reply with quote

To make it faster, write the file directly to the local file system of the script that will be receiving it (via mapped drive or direct UNC path). Then use IfExist in a loop to check for it periodically. That should use very close to 0% CPU time (since it is checking a local file, not a remote file).

I've not noticed any performance impact when doing it this way. If I recall correctly, even on a slow CPU less than 1% CPU time is used (depending on how often you check for the file).
Back to top
View user's profile Send private message Send e-mail
Tekl



Joined: 24 Sep 2004
Posts: 813
Location: Germany

PostPosted: Thu Oct 14, 2004 1:12 pm    Post subject: Reply with quote

Do you think it's faster than using a remote-registry? What about a system, where the memory is full and swapping is active? Also while working with big files in Photoshop the HD will be extremely used. Does checking the file slows it down?

Tekl
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Oct 14, 2004 3:08 pm    Post subject: Reply with quote

I'm not sure if remote registry is any faster. As a guess, I would expect it to be slightly faster for the remote machine when it reads from its local registry.

Quote:
Also while working with big files in Photoshop the HD will be extremely used. Does checking the file slows it down?
Due to the OS's built-in disk caching, it seems unlikely that checking for the existence of a file -- even if done multiple times per second -- would slow down a disk-intensive task by more than 0.1% (one tenth of 1 percent). This is because I expect that the disk is not even physically accessed; instead, the OS consults the cached directory structure and immediately discovers the file is (or is not) there.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group