Hi Tim, hi all, i was just looking at your lock-free fifo code in devel_0_38, to adapt it for a more general C++ container in flext. It seems that the x86 CAS/CAS2 fragment are ok, but not the PPC CAS2 code. http://www.go-ecs.com/ppc/ppctek1.htm#semsupp says that lwarx/stwcx instruction can not be nested, because there is only one memory watcher per cpu available. On the other hand, maybe there's a way to exploit that the memory watching unit always looks at an entire cache line (64 bytes)?! I don't know.....
best greetings, Thomas
It seems that the x86 CAS/CAS2 fragment are ok, but not the PPC CAS2 code. http://www.go-ecs.com/ppc/ppctek1.htm#semsupp says that lwarx/stwcx instruction can not be nested, because there is only one memory watcher per cpu available. On the other hand, maybe there's a way to exploit that the memory watching unit always looks at an entire cache line (64 bytes)?! I don't know.....
well, i had a bad feeling about the cas2 on ppcs ... still, i didn't have the time to work with a mac ... from what i read about the ppc architecture, there is no cas2 or dcas available out of the box, so i'll have to have a look at the fifo algorithm again... maybe i can somehow adapt it to get it working on ppcs ...
i'll look into it again, when i have some more time ...
cheers ... tim
Hi Tim, please have a look at http://cvs.sourceforge.net/viewcvs.py/midishare/midishare/src/common/Headers... The people at Grame have done a wonderful implementation of a fifo using two lifos, now using only CAS and no more CAS2. This implementation has the further advantage that no additional dynamic allocation is necessary. The cell structure used for the lifos/fifos can take additional data.
best greetings, Thomas
Tim Blechmann schrieb:
It seems that the x86 CAS/CAS2 fragment are ok, but not the PPC CAS2 code. http://www.go-ecs.com/ppc/ppctek1.htm#semsupp says that lwarx/stwcx instruction can not be nested, because there is only one memory watcher per cpu available. On the other hand, maybe there's a way to exploit that the memory watching unit always looks at an entire cache line (64 bytes)?! I don't know.....
well, i had a bad feeling about the cas2 on ppcs ... still, i didn't have the time to work with a mac ... from what i read about the ppc architecture, there is no cas2 or dcas available out of the box, so i'll have to have a look at the fifo algorithm again... maybe i can somehow adapt it to get it working on ppcs ...
i'll look into it again, when i have some more time ...
cheers ... tim
please have a look at http://cvs.sourceforge.net/viewcvs.py/midishare/midishare/src/common/Headers... The people at Grame have done a wonderful implementation of a fifo using two lifos, now using only CAS and no more CAS2. This implementation has the further advantage that no additional dynamic allocation is necessary. The cell structure used for the lifos/fifos can take additional data.
thanks for the hint ...
i was following the paper, written by the guys from grame ... haven't had a look at the midishare source code, though ... i'll look into it and try to adapt the fifos accordingly ...
cheers ... tim
On Fri, 25 Feb 2005, Thomas Grill wrote:
http://cvs.sourceforge.net/viewcvs.py/midishare/midishare/src/common/Headers... The people at Grame have done a wonderful implementation of a fifo using two lifos,
What's the advantage of using two lifos over using one circular fifo? If neither is dynamically reallocated, neither is resizable either, and both are essentially equivalent, no?
_____________________________________________________________________ Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju
What's the advantage of using two lifos over using one circular fifo? If neither is dynamically reallocated, neither is resizable either, and both are essentially equivalent, no?
There's no principle advantage, other than to get a lock-free fifo for all platforms. The old implementation was buggy. Talking to Yann Orlarey he stated that Grame is working on a separate fifo implementation as well. Please note also that it's is a linked list fifo, so no reallocation needed... on the other hand the "cell" elements have to be dynamically allocated before insertion.
best greetings, Thomas