RE: windows "thread" question

new topic     » topic index » view thread      » older message » newer message

> From: Kat <gertie at PELL.NET>
> To: EUforum <EUforum at topica.com>
> Reply-To: EUforum at topica.com
> Subject: windows "thread" question
> Date: 28/09/2001 12:12:41 PM
> 
> 
> Hi all windows programmers, i have a 
> question, and i am not sure i can 
> explain it properly, but i'll try...
> 
> Lets say i have 3 Eu programs running...
> 
> program1 program2, program3
> 
> and they each know the others *can* exist, 
> and they know how to 
> handshake with the other program to verify 
> the other program is there. Just 
> how they do this would be OS dependant, 
> i'll use win95 and either DDE, 
> winsock, or win_msgs. Commands they can 
> exchange would be, for each 
> program:
> 
> dothis1a, dothis1b, abort1
> dothis2a, dothis2b, abort2
> dothis3a, dothis3b, abort3
> 
> The commands represent functions, which 
> return nested sequences. Each 
> program knows what is returned in the 
> nested sequence. Suppose program1 
> is told to insert code before the return() 
> line in program2. It cannot change 
> the existing returned sequence, but it can 
> add another nested sequence to 
> that original one, and the calling program 
> can ignore that additional sequence 
> if it wants to, or not, for whatever 
> reason. Program1 would use this additional 
> code by doing abort2, and restarting the 
> modified program2. 
> 
> Here is the question:
> How does program3 know what program1 is 
> doing to program2 in terms of 
> the abort2? Program3 could be calling 
> dothis2b while program1 has just 
> called abort2. Program3 did a handshake 
> with program2 to verify it was 
> there, but right after that handshake, 
> program1 shut down program2! How do 
> i prevent this? Can i make the windows 
> program2 ignore the abort2 event 
> (from program1) or the dothis2b event 
> (from program3)?
> 
> What if the OS delivers abort1 from 
> program2 while program1 is waiting on a 
> result from program2's dothis2a?
> 
> How can i be sure of the order of msg 
> arrival, and make the order of recieved 
> msgs execute in the "right" order? For 
> timestamping the msgs, i can't even 
> be positive of the time() function in Eu 
> if the OS is preemptively timeslicing 
> the programs out, can i? What if program1 
> gets time(), the OS pages out to 
> program3 which does time() *and* then 
> sends the msg, i *still* cannot be 
> sure of which msg will arrive at program2 
> first, can i?,,, because now 
> program1 executes and delivers the msg to 
> program2's que, right?, before 
> the msg from program3 is actually 
> delivered to program2. And i just showed 
> how the timestamps could be reversed.
> 
> Yes, i am considering self-modifying 
> programs, and self-cloning programs, 
> with Euphoria. Or should i look at another 
> language?

If you are sticking with Windows, can I suggest you investigate the
CreateMutex() and related API calls. These enable independant processes to
synchorize with each other to make sure that all data is "current" etc...

------
Derek


--------------------------------------------------------------------
CAUTION - This email and any files attached may contain privileged and
confidential information intended solely for the use of the individual or
entity to whom they are addressed. If you are not the intended recipient of
this message you are hereby notified that any use, dissemination,
distribution or reproduction of this message is prohibited. If you have
received this message in error please notify the sender immediately. Any
views expressed in this message are those of the individual sender and may
not necessarily reflect the views of Global Technology Australasia Limited.
--------------------------------------------------------------------

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu