Wednesday, August 24, 2016

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

bleachbot <bleachbot@httrack.com>: Aug 24 12:14AM +0200

bleachbot <bleachbot@httrack.com>: Aug 24 12:20AM +0200

Ramine <ramine@1.1>: Aug 23 06:20PM -0400

Hello,
 
Read again my corrected post...
 
In this post i will explain to you what i have written 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 how 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
returned 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.
Ramine <ramine@1.1>: Aug 23 06:16PM -0400

Hello,
 
Read again my corrected post...
 
In this post i will explain to you what i have writtenas 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 how 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
returned 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.
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: