Re: Dynamic C to C Data Transfer



On Sat, 16 Dec 2006 18:11:49 GMT, Tom wrote:
The scenario is: Several networked machines. Each performing stock
analysis on individual or a small group of financial instruments and
then passing buy/sell instructions to an order placing machine.
....
Sort of like a common file shared by several computers and programs at
once?

From that I suppose you machines have access to a common (LAN)
directory which they shall use to exchange data via files?

Several programs being able to simultaneously have open and to
have write privileges to a single file is not possible?

That depends on the file system (better assume nothing).

Even with the
usage of SEEK to the file end and flushing the buffer at each write
... two programs might be writing at the same time. Thus the single
file approach seems to this rookie as impossible.

Probably yes.

However, each
program on the server computer(s) could write to a specific file set
up for each financial instrument and the central computer could open,
read, and then close these files at a specified timed interval? The
reason to write to two files and thus duplicating the task is an
attempt to avoid timing conflicts.

I don't quite understand that. But let's assume we have 2 computers
(pc1, pc2) that have to exchange data via a common directory and shall
not disturb each other. I would define a name and behavior convention:
In the specified common directory pc1 opens only the file with the
name 'to_pc1.dat' and pc2 opens only the file 'to_pc2.dat'. To
exchange data between pc1 and pc2 the following steps need to be
performed:
- pc1 copies the data to the common directory with a temporary file
name
- after copying is finished pc1 renames the file to 'to_pc2.dat'
- pc2 opens (only!) the file 'to_pc2.dat' and changes it
- afterwards pc2 renames the file to 'to_pc1.dat'
- and so on
The point is that pc1 and pc2 never concurrently access (not even
read) the same file and that the rename() function is atomic. You need
to implement some sort of polling to make it work and the approach
isn't very fast. But everything can be done in Standard C (but you
should e.g. look for the sleep() function for polling).

Hope that's relevant to your problem,
Roland Pibinger
.



Relevant Pages

  • ZoneAlarm missing Firewall Zones tab for subnet. New NAT router wont show Entire Network.
    ... Per Netgear quick install, Internet worked for both ... PCs - - Good. ... pc1 can see pc2 files. ...
    (comp.security.firewalls)
  • winXPproSP2 cant be found on network.
    ... PC1 can access files in the shared folders of both PC2 and PC3 ... Status for domain HIGHCOUNTRY on transport ...
    (microsoft.public.windowsxp.network_web)
  • Re: one way share
    ... My most recent update of McAfee Security Center included a firewall. ... The PC2 printer showed up automatically as a PC1 computer. ... On PC2 My Network Places shows the shared files for both computers. ...
    (microsoft.public.windowsxp.network_web)
  • Open mdb in the network
    ... I've made a mdb and the base is in the PC1. ... This file is located out of the intranet or in a non secure site. ... PC1 and PC2 have WinXP Pro and AccessXP instaled. ...
    (microsoft.public.access.security)
  • Home network (LAN) problems
    ... PC1 has a built-in LAN ... PC2 has a PCI lan card. ... Everytime I try to "repair" the LAN setup, I end up with the same message. ...
    (microsoft.public.windowsxp.network_web)