www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/12/18:11:14

Message-Id: <3.0.6.32.19990212180944.0089a1a0@pop.netaddress.com>
X-Sender: pderbysh AT pop DOT netaddress DOT com
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
X-Priority: 1 (Highest)
Date: Fri, 12 Feb 1999 18:09:44 -0500
To: djgpp AT delorie DOT com
From: Paul Derbyshire <pderbysh AT usa DOT net>
Subject: [Semi-OT] Making a transaction.
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

REPOST: First didn't get enough responses.

I've become stumped by a signaling problem.

Say we have two machines on a network, A and B. We want to send a message
from A to B, but we want, within a short time after the fact, for one of
two situations to be the case:

1. B received the message successfully and A and B performed some
   action to do with the message that needs to be atomic, such as an
   electronic funds tranfer (as an example).
2. Neither A nor B performed the action.

The basic problem then is sending a message and having both sides know for
sure that either the message succeeds or it fails.

A problem arises. The simplest apparent solution is to have B send an
acknowledgement to A. But the acknowledgement may go missing, so we need B
to be sure A got it, and we enter an infinite regress.

Can anyone here give, or concoct, a solution to this problem? e.g. a way
for A and B, in finite time, to wind up in state 1 or 2 above. The solution
can include timeouts, heartbeats, "naks" that are sent due to failure to
receive an expected message, and so forth, as long as the number of
messages involved in a transaction can be kept reasonable, say, under 20
(with a continuous heartbeat possible added on).

Whoever emails me or the list the solution that a) has no loopholes or bugs
and b) has the fewest message-passes per transaction, wins.

The winner gets a heartfelt thanks from me, and gets to have his or her
name attached to the code I wind up writing based on it. (In the library
readme file/docs under contributors, in the source code, and in a string
that should end up in every binary built from it. A contributor in my view
need not have submitted actual code; ideas, major help, pseudo code,
algorithms, data that is a component of the product, example code, bug
reports and fixes, anthing significant is a contribution. DJ Delorie, Eli
Zaretskii, and Nate Eldridge are in the Hall of Fame already, and so are
any people whose source code I cannibalize (Shawn Hargreaves will probably
end up in there since I'll study/cannibalize Allegro code)...)



-- 
   .*.  "Clouds are not spheres, mountains are not cones, coastlines are not
-()  <  circles, and bark is not smooth, nor does lightning travel in a
   `*'  straight line."    -------------------------------------------------
        -- B. Mandelbrot  |http://surf.to/pgd.net
_____________________ ____|________     Paul Derbyshire     pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019