updates to many ships
[fleet.git] / ships / Stack.ship
index 7febad6..aca2883 100644 (file)
@@ -9,16 +9,30 @@ data  out:  pop
 == TeX ==============================================================
 A stack ship with capacity for at least 32 elements.
 
-Push operations are executed as soon as an inbound datum is {\tt
-deliver}ed on the {\tt push} port.  Completion of a push can be
-confirmed by sending a {\tt notify} token from the {\tt push} port.
+Push operations are executed as soon as an inbound datum is delivered
+to the {\tt push} port.  Completion of a push can be confirmed by
+sending a {\tt notify} token from the {\tt push} port.
 
 Pop operations are executed no earlier than the time at which the {\tt
 pop} port attempts to {\tt take} data from the ship.
 
 When the stack becomes full, it will simply not process any new {\tt
 push} operations.  When the stack becomes empty, it will simply not
-process any new {\tt pop} operations.
+process any new {\tt pop} operations.  Phrased another way, if a {\tt
+pop} is issued to an empty stack, that operation will wait for a {\tt
+push} to occur; at some point after that, the {\tt pop} will proceed
+to pop the pushed value.  There is no ``underflow'' or ``overflow.''
+
+\subsection*{To Do}
+
+There is some difficulty here when it comes to arbitration -- does the
+execution of the instruction after the {\tt deliver} to the {\tt push}
+port indicate that the value has been safely pushed?  This is much
+tricker than it seems.
+
+Perhaps there should be a single port, {\tt operation}, to which
+either a {\sc PUSH} or {\sc POP} command is sent.  This would simplify
+the arbitration issues.
 
 == Fleeterpreter ====================================================
     private ArrayList<Long> stack = new ArrayList<Long>();