On Sat, 16 Dec 2006 15:33:40 GMT,
rp*****@yahoo.c om (Roland Pibinger)
wrote:
>On Sat, 16 Dec 2006 13:47:40 GMT, Tom wrote:
>>I need my data generating C program on computer #1 to export small
amounts of data (one - 40 byte data structure) periodically (once per
minute) to a C program on computer #2.
I am considering having computer #1 to create two duplicate data files
sequentiall y. (file_1.dat & file_2.dat).
Then, Computer #2 tries to open file_2.dat and upon failure it opens
file_1.dat.
Due to how small these files are ... one of these two files should
always be "available" for Computer #2.
Can you explain the rationale behind that proceeding?
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.
The central machine follows/enforces portfolio rules and the results
of the individual instrument analyses must be agglomerated ... but the
individual analyses is too complex and cumbersome for one personal
computer to perform the analysis for every instrument in the
portfolio. Thus I need to use some sort of parallel processing.
The rational is: I am a novice in data transfer methods and I don't
know where to begin. I am not a proficient or professional programmer
by any stretch. HA!! (Big joke.) However, I am better than average in
technical analysis, mathematics, and process design and optimization.
My hope is there is a best method for doing this within C so that I
don't have to venture outside the structured C approach that I like.
Sort of like a common file shared by several computers and programs at
once? Several programs being able to simultaneously have open and to
have write privileges to a single file is not possible? 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. 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 am looking for functionality and
simplicity over elegance. Although I find the simplest method that is
reliable to be very elegant in my eyes. This level of data transfer
between multiple programs running simultaneously is obviously new
ground for me. As powerful as C is ... there's got to be a best method
and I'd bet the farm (if I had one) that several of the many gurus in
this user group has the knowledge.