[fpc-devel] LockFree Queue algorithm

Michael Schnell mschnell at lumino.de
Thu Jan 31 10:23:18 CET 2008


Very interesting stuff indeed !

In your case of course my idea of using something similar to FUTEX 
supposedly will not help much, as it would prevent unnecessary system 
calls done by semaphore handlers like "TCriticalSection" and thus reduce 
the overhead, but will not cure things like priority inversion and 
unnecessary waits for locked structures. So of course I do see that a 
lockfree implementation is the way to go. This definitively holds for 
tasks were the duration of the necessary lock is quite big. My initial 
intention was a byte FIFO. Here, IMHO, the additional effort for a lock 
free implementation might be in vain, as the act of transferring the 
byte in and out the FiFo (or Stack) is minimal.

Do you already have a theoretical background to decide when/how a 
lockfree implementation can be done. Do you think a lockfree version of 
TThreadList could be done and perform decently ? OTOH TThreadList  is 
very bed for implementing a FIFO. What should be the specs of a 
component that would be useful for most of what can be done with 
TThreadList plus where a fast FiFo is needed.

I'll forward your offer for collaboration to a friend of mine who in 
fact is Austrian but lives in Germany. He does not want a Job, as he is 
a consultant, but he is very comfortable with large Delphi Language 
projects and even with Telephony applications. So he might be a useful 
partner for you.

-Michael



More information about the fpc-devel mailing list