>An unhandled exception occurred at $0809F010 :
>EAccessViolation : Access violation
> $0809F010 GETTHREADID, of LockFreePrimitives.pas
> $0809E9C2 TGJRINGBUFFER__MEASUREEXECUTIONTIMES, line >240 of RingBuffer.pas
[...]
So, if you want to run it on Ubuntu 9.10 just
delete the 'uses parallelqueuerb,ringbuffer' inside
threadpool.pas, after that compile it and tell me
if it's working on Ubuntu 9.10 correctly.
I think the same applies to any Linux, not just Ubuntu. I have OpenSuse.
The code doesn't even compile as is.
Amine, if you plan to support other platforms than Windows, please do the following changes:
1. Replace "IFDEF FreePascal" with "IFDEF FPC".
2. Units are not found in a casesensitive file system. Either rename all units to lowercase or match their (casesensitive) names exactly in USES section.
After those changes I could compile and run and then I also got Access violation.
Then I commented out {parallelqueuerb,ringbuffer} as you suggested and got an exception + SIGSEGV in TThreadPool.Terminate on line :
for I := 0 to FThreadCount - 1 do FThreads
.Terminate;
This code is not inherently Windows dependent so I think it is worth porting and testing it under other platforms, too.
Juha