For example, there are auctions like those organized by Southeby's where the seller fixes a minimal prices. Then potential buyers have a limited amount of time to submit their bids, there may be several rounds of bids, each bidder trying to outbid its opponents. Finally the auction is closed, awarding the good to the bidder that offered to pay the most.
In continuous auctions we have a fully symmetric configuration with multiple bidders and multiple sellers. Price offers to buy and buy offers to sell may be submitted at any time, and may be retracted at any time. A public order book lists the currently best (highest) bids and best (lowest) sell offers. As soon as one bidder offers a price that is equal or better to the lowest sell offer, the CDA matches these offers. They are removed from the system and from the order book. Today's electronic stock exchanges usually work with CDAs.
From an Operating System point of view, CDAs can be considered as an anonymous synchronization primitive where the system only reveils the price and quantity of items that a party wants to buy or sell and where the parties block until a match can be made. A single synchronization primitive is provided:
long long cda_offer(int handle, int *quantity, int *price, struct timeval *timeout)where:
cda_create(int orderbooksize)call.
% cat 198526454 0@0 3@6 2@7 10@8 5@9 5@20The notation is quantity@price, the first half of the entries are buy bids, the second half are sell offers (asks). In the example we would have an orderbook of size 6, with only two buy offers in it, one wanting to buy three items at a price of 6, and another for 2 items at a price of 7. Three sellers offer to give away items at prices 8, 9 or 20.
Last updated: April 15, 1999 http://www.docs.uu.se/~tschudin