vtest "Barrier operations"

# bs -> server, bc -> client, bb -> both
barrier bs cond 4
barrier bc cond 4
barrier bb cond 4 -cyclic

server s1 {
	rxreq
	barrier bs sync
	barrier bb sync
	delay .9
	txresp
} -start

server s2 {
	rxreq
	barrier bs sync
	barrier bb sync
	delay .6
	txresp
} -start

server s3 {
	rxreq
	barrier bs sync
	barrier bb sync
	delay .2
	txresp
} -start

client c1 -connect ${s1_sock} {
	delay .2
	txreq
	rxresp
	barrier bc sync
	barrier bb sync
} -start

client c2 -connect ${s2_sock} {
	delay .6
	txreq
	rxresp
	barrier bc sync
	barrier bb sync
} -start

client c3 -connect ${s3_sock} {
	delay .9
	txreq
	rxresp
	barrier bc sync
	barrier bb sync
} -start

# Wait for all servers to have received requests
barrier bs sync
barrier bb sync

# Wait for all clients to have received responses
barrier bc sync
barrier bb sync
