Saturday, August 20, 2016

Digest for comp.programming.threads@googlegroups.com - 6 updates in 4 topics

Ramine <ramine@1.1>: Aug 19 08:23PM -0400

Hello,
 
 
In this post i will explain to you what i have wrote
as 64 bit assembler routines for my Stackful coroutines
library..
 
But first comes first, why have i decided to implement
this assembler routines of my stackful coroutines library ?
 
I have decided to do it because i have learned how the operating
system saves and restores the registers and the stacks when
it works with threads , because coroutines are not far away from
threads, you can learn a lot on implementing threads by imlementing
coroutines..
 
 
Now what is the important advantages of my coroutines library?
 
- Context switching is expensive with threads, with coroutines it is
really fast.
 
- Coroutines eliminate race conditions and that's really interesting
on embedded systems and other applications.
 
- My mutex and semaphore of my coroutines library are much much
more faster than the mutex and semaphore used on processes and threads.
 
 
Now have i implemented it with 64 bit assembler routines?
 
First you have to replace the RSP and RBP registerS with a pointer to
a dynamic allocated memory to be able to save the local variables
of the coroutines.
 
Second, you have to avoid to generate the stack frames to simplify
the implementation in assembler, this will simplify the saving
of the RBP register for example, and you have to search for the
retruned IP register address with the RSP register to to be able
to return back from the yield() routine, other than that
you have to save some registers and restores them back.
 
 
You can download my Stackful coroutines library for Delphi and
FreePascal from:
 
https://sites.google.com/site/aminer68/stackful-coroutines-library-for-delphi-and-freepascal
 
You can download my Object oriented Stackful coroutines library for
Delphi and FreePascal from:
 
https://sites.google.com/site/aminer68/object-oriented-stackful-coroutines-library-for-delphi-and-freepascal
 
 
That's all for today.
 
 
Thank you,
Amine Moulay Ramdane.
bleachbot <bleachbot@httrack.com>: Aug 19 10:51PM +0200

bleachbot <bleachbot@httrack.com>: Aug 19 10:53PM +0200

bleachbot <bleachbot@httrack.com>: Aug 20 02:22AM +0200

Ramine <ramine@1.1>: Aug 19 04:54PM -0400

Hello..
 
 
About Stackful coroutines library for Delphi and FreePascal
 
Here is the registers that i have saved in my 64 bit assembler routines:
 
R15,R14,R13,R12,RSI,RDI,Return IP address, RBP,RSP, but i have not saved
the XMM registers on 64 bit compilers in my assembler routines, so with
fastcall calling convention you have to pass the floating-point
arguments by reference or use dynamic memory.
 
You can download my Stackful coroutines library for Delphi and
FreePascal from:
 
https://sites.google.com/site/aminer68/stackful-coroutines-library-for-delphi-and-freepascal
 
You can download my Object oriented Stackful coroutines library for
Delphi and FreePascal from:
 
https://sites.google.com/site/aminer68/object-oriented-stackful-coroutines-library-for-delphi-and-freepascal
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <ramine@1.1>: Aug 19 04:53PM -0400

Hello,
 
 
About Stackful coroutines library for Delphi and FreePascal
 
Here is the registers that i have saved in my assembler routines:
 
R15,R14,R13,R12,RSI,RDI,Return IP address, RBP,RSP, but i have not saved
the XMM registers on 64 bit compilers in my assembler routines, so with
fastcall calling convention you have to pass the floating-point
arguments by reference or use dynamic memory.
 
You can download my Stackful coroutines library for Delphi and
FreePascal from:
 
https://sites.google.com/site/aminer68/stackful-coroutines-library-for-delphi-and-freepascal
 
You can download my Object oriented Stackful coroutines library for
Delphi and FreePascal from:
 
https://sites.google.com/site/aminer68/object-oriented-stackful-coroutines-library-for-delphi-and-freepascal
 
 
Thank you,
Amine Moulay Ramdane.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.programming.threads+unsubscribe@googlegroups.com.

No comments: