Friday, August 9, 2019

Digest for comp.programming.threads@googlegroups.com - 1 update in 1 topic

aminer68@gmail.com: Aug 08 12:28PM -0700

Hello,
 
 
My new Object oriented Stackful coroutines library for Delphi and FreePascal
is here..
 
Take a look at my source code and notice that it is a powerful implementation..
 
 
Author: Amine Moulay Ramdane
 
Description:
 
This is an object oriented library to do Stackful Coroutines for FreePascal and Delphi and it comes with a semaphore and a mutex,
and it works on both Windows and Linux.
 
Because threads alone are expensive on windows because each thread can take one Megabytes of stack and the thread context
switch is expensive, so you can use this library with my Threadpool engine that scales well to be able to serve a great number of internet connections or TCP/IP socket connections, and of course you can do with it many other things such as simulations etc.
 
Here is the use cases of this object oriented coroutines library:
 
- Context switching is expensive with threads, with coroutines it is
really fast.
 
- My mutex and semaphore of my coroutines library are much much more faster than the mutex and semaphore used on processes and threads.
 
Main features:
 
Very small RAM overhead and provides semaphore and mutex.
 
Note: 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.
 
I have come to an interesting subject...
 
Is my Object coroutines library still useful ?
 
Can threads do the same job as coroutines ?
 
I think that coroutines are still useful because a lock or a cache-line transfer is expensive on threads running on multicores, a cache-line transfer between cores is around 800 CPU cycles on x86 , and that's too much expensive compared to coroutines, and the semaphore and mutex of my coroutines library and the contention on them are thus much much less expensive, other than that coroutines can yield to other functions or procedures inside a function or procedure, so i think that coroutines are thus still useful.
 
Also take a web server. It has multiple simultaneous connections, and it wants to schedule reading and writing all of them.
 
This can be implemented using coroutines. Each connection is a coroutine that reads/writes a small amount of data, then "yields" control to the scheduler, which passes to the next coroutine (which does the same thing) as we cycle through all the available connections.
 
 
You can download my new Object oriented Stackful coroutines library for Delphi and FreePascal from:
 
 
https://sites.google.com/site/scalable68/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: