On Sat, 16 Apr 2011 06:43:02 -0500 John McKown <[email protected]> wrote:
:>On Sat, 2011-04-16 at 10:32 +0000, [email protected] wrote: :>> After reading all of these suggestions and recomendations, :>> it would have been nice to see some actual code posted :>> (CS CDS PLO) to further demonstrate the techniques being discussed. :>I think this is a very good idea. I have used the CS and CDS :>instructions on rare occassion. I've never used the PLO. PLO has many :>sub-functions. An example of each in some actual code would be very :>instructive. I don't have any non-NDA code that I can post, but the basic advantage of the PLO is that it avoids the need for locks with non-contiguous serialized areas if the retry rate is low. Say you wish to run a linked list where elements can be added or removed at any time. You place a counter/token in the queue header which is incremented upon every add of delete. The PLO-CL instruction allows a serialized fetch where the chain pointer is only used if the token is unchanged. An element can be added in the middle of the linked list via PLO-CSDS where the token is checked, and if unchanged element(x) forward pointer now points to the new element and element(x+1) back pointer does as well. If the retry rate (PLO failures) is high enough (for whatever value of enough) it becomes worth locking. A unfortunate side of PLO is that it does not play with C(D)S where a PLO and CS on the same word do not serialize with each other - thus if you use PLO for disjoint fields, you must also use PLO for a more simple function (which could be done via CS) on the same field. -- Binyamin Dissen <[email protected]> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel Should you use the mailblocks package and expect a response from me, you should preauthorize the dissensoftware.com domain. I very rarely bother responding to challenge/response systems, especially those from irresponsible companies.
