aboutsummaryrefslogblamecommitdiffstats
path: root/doc/protocol
blob: def8f6fcc79ab3643d0ee8c5a1e05323d38d80f4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
       

                          


                                                                         
 


                                                                          





                                                      


                    


       










                                                          
 
create:
	Select a filename.

	Create XSI semaphore array {S = 0, W = 0, X = 1, Q = 0 and N = 0}
	with random key. Store the semaphore array's key in decimal form
	on the first line in the selected file.

	Create XSI shared memory, with an allocation of 2048 bytes, with a
	random key. Store the shared memory's key in decimal form on the
	second line in the selected file.


broadcast:
	with P(X):
	  Z(W)
	  Write NUL-terminate message to shared memory
	  with V(N):
	    Q := 0
	    Z(S)


listen:
	with V(S):
	  forever:
	    V(Q)
	    Z(Q)
	    Read NUL-terminated message from shared memory
	    if breaking:
	      break
	    with V(W):
	      with P(S):
	         Z(S)
	         Z(N)