FUTEX is based on atomic operation, the same as I used.
but with lockfree algorithms You don't protect access at all.

I understand this, but I'm nut sure that this really is advantageous.

Any atomic operation in a multicore system with a cache for each core imposes a delay for cache synchronization. Thus as little as possible "lock" operations should be issued. 99,99% of the calls will not see another processor or thread concurrently working on the FiFo data.

The implementation similar to Futex in the no blocked case needs one lock operation on entry and one on exit. Thus using a thing similar to FUTEX needs some 2,0001 locked operations per call.

An implementation with a single lock operation per call - if possible - would be better, of course.

-Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to