Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The following libraries have been ported to 64 bits architecture...

0 views
Skip to first unread message

aminer

unread,
Jun 3, 2012, 10:22:21 AM6/3/12
to

The following libraries have been ported to 64 bits architecture...


1. My ParallelSort library

2. My ParallelGzip inside my parallelcompression library,
but you have to use the zlib1.dll for 64 bits architecture.

3. Lockfree_mpmc

4. Parallelhashlist

5. Threadpool engine.


To compile them, for 64 bits architecture, just open the defines.inc
and use the following defines:
{$DEFINE CPU64} for 64 bits architecture

{$DEFINE CPU32} for 32 bits architecture


You have to use Freepascal for 64 bits architecture
or Lazarus for 64 bits architecture to compile the
libraries for 64 bits architecture.

You can download those libraries from:

http://pages.videotron.com/aminer/



Thank you.
Amine Moulay Ramdane.









aminer

unread,
Jun 3, 2012, 10:31:53 AM6/3/12
to
Hello,


I have ported those libraries to the 64 bits architecture
and tested those libraries under Windows 2008 64 bits
and they are working correctly.


Thank you,
Amine Moulay Ramdane

"aminer" <ami...@videotron.ca> wrote in message
news:jqfoej$iqt$1...@dont-email.me...

aminer

unread,
Jun 3, 2012, 11:05:23 AM6/3/12
to

Hello,

Since my threadpool engine is using lockfree_mpmc
I had to port lockfree_mpmc to 64 bits architecture an
this was easy , i had to change two thinks, first i had to
change the longword type to use a qword type (8 bytes types),
and also i had to change the CAS to support the 64 bits architecture.

I have changed also the following inside my thread pool engine:

Before entering the wait state the worker threads have to do a test like
this: If ThreadPool.Queues[self.threadcount].count <> 0 Then continue


Like this
--
If ThreadPool.Queues[self.threadcount].count <> 0
Then continue;

for i:=0 to FThreadpool.Fthreadcount-1 do
count:=count+FThreadPool.Queues[i].count;

if count=0 then
begin
FThreadpool.events[self.threadcount].waitfor(INFINITE);
FThreadpool.events[self.threadcount].resetevent;
end;
---

And the following have been added to Threadpool:

Lock-free_mpmc - flqueue that i have modified, enhanced and improved... -
1. It uses a lock-free queue for each worker thread and it uses
work-stealing - for more efficiency -
2. The worker threads enters in a wait state when there is no job in the
lock-free queues - for more efficiency -
3. You can distribute your jobs to the worker threads and call any method
with the threadpool's execute() method.


Here is the first change for 64 bits architecture in lockfree_mpmc:

--
type
{$IFDEF CPU64}
long = qword;
{$ENDIF CPU64}
{$IFDEF CPU32}
long = longword;
{$ENDIF CPU32}
---

and here is the CAS in lockfree_mpmc that i have changed to support
the 64 bits architecture:

--
function CAS(var Target:long;Comp ,Exch : long): boolean;assembler;stdcall;
asm
{$IFDEF CPU64}
mov rax, comp
lock cmpxchg [Target], Exch
setz al
{$ENDIF CPU64}
{$IFDEF CPU32}
mov eax, comp
mov ecx,Target
mov edx,exch
lock cmpxchg [ecx], edx
setz al
{$ENDIF CPU32}

---


And the Object Pascal language was fun fun...

And here is where you can download Lazarus for 64 bits architecture:

http://www.lazarus.freepascal.org/

And here is where you can download Freepascal for 64 bits architecture:

http://www.freepascal.org/



Thank you,
Amine Moulay Ramdane.




"aminer" <ami...@videotron.ca> wrote in message
news:jqfoej$iqt$1...@dont-email.me...
>
0 new messages