Sunday, June 28, 2020

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

aminer68@gmail.com: Jun 27 01:59PM -0700

Hello...
 
 
I am a white arab, and i think i am smart, and here is my new proverb:
 
Note that the English dictionary defines "perfection" as: "the act or process of perfecting"
 
Read here:
 
https://www.merriam-webster.com/dictionary/perfection
 
 
This is the definition of perfection above that I use below in my explanation of my new proverb.
 
Here is all my explanation of my new proverb below:
 
My new proverb comes to me from the essence of morality that I explained to you in my political philosophy that I wrote in English, since in morality we are pushed towards the pretty tomorrow because we are aware of this pretty perfume that is the perfection that pushes us or encourages us to be or allows us to become perfect or greatly perfect.
 
Read about it here on my thoughts of my political philosophy about morality:
 
https://groups.google.com/forum/#!topic/alt.culture.morocco/7UmkfURwoU4
 
 
So here is my new proverb:
 
 
"Life is like the pretty perfume that calls us to be a pretty tomorrow!"
 
 
So notice carefully my smart play on words in my new proverb, i think it's smart, and you have to know that the future perfection depends on the present perfection, so when today we are responsibility to be the pretty perfection so that to build the pretty tomorrow, then the pretty perfection of today is part of the pretty tomorrow, and the "pretty perfume" in my new proverb is also the today pretty perfection, but you have to understand the symbolic which allows us to say that being this part of the pretty tomorrow is also like being the pretty tomorrow. It is what makes it a smart proverb.
 
 
thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Jun 27 09:02AM -0700

Hello,
 
 
Yet more precision about my inventions that are my SemaMonitor and SemaCondvar and my Monitor..
 
My inventions that are my SemaMonitor and SemaCondvar are fast pathed when the count of my SemaMonitor or my SemaCondvar is greater than 0, so in this case the wait() method stays on the user mode and it doesn't switch from user mode to kernel mode that costs around 1500 CPU cycles and that is expensive, the signal() method is also fast pathed when there is no item in the queue and count is less than MaximumCount, read here about what is the cost (in CPU cycles) to switch between windows user mode and kernel mode:
 
https://stackoverflow.com/questions/1368061/whats-the-cost-in-cycles-to-switch-between-windows-kernel-and-user-mode#:~:text=1%20Answer&text=Switching%20from%20%E2%80%9Cuser%20mode%E2%80%9D%20to,rest%20is%20%22kernel%20overhead%22.
 
You can read about and download my inventions of SemaMonitor and SemaCondvar from here:
 
https://sites.google.com/site/scalable68/semacondvar-semamonitor
 
And the light weight version is here:
 
https://sites.google.com/site/scalable68/light-weight-semacondvar-semamonitor
 
And i have implemented an efficient Monitor over my SemaCondvar.
 
Here is the description of my efficient Monitor inside the Monitor.pas file that you will find inside the zip file:
 
Description:
 
This is my implementation of a Monitor over my SemaCondvar.
 
You will find the Monitor class inside the Monitor.pas file inside the zip file.
 
When you set the first parameter of the constructor to true, the signal will not be lost if the threads are not waiting with wait() method, but when you set the first parameter of the construtor to false, if the threads are not waiting with the wait() method, the signal will be lost..
 
Second parameter of the constructor is the kind of Lock, you can set it to ctMLock to use my scalable node based lock called MLock, or you can set it to ctMutex to use a Mutex or you can set it to ctCriticalSection to use the TCriticalSection.
 
Here is the methods of my efficient Monitor that i have implemented:
 
TMonitor = class
private
cache0:typecache0;
lock1:TSyncLock;
obj:TSemaCondvar;
cache1:typecache0;
 
public
 
constructor Create(bool:boolean=true;lock:TMyLocks=ctMLock);
destructor Destroy; override;
procedure Enter();
procedure Leave();
function Signal():boolean;overload;
function Signal(nbr:long;var remains:long):boolean;overload;
procedure Signal_All();
function Wait(const AMilliseconds:longword=INFINITE): boolean;
function WaitersBlocked():long;
 
end;
 
 
The wait() method is for the threads to wait on the Monitor object for
the signal to be signaled. If wait() fails, that can be that the number
of waiters is greater than high(longword).
 
And the signal() method will signal one time a waiting thread on the
Monitor object, but if signal() fails , the returned value is false.
 
the signal_all() method will signal all the waiting threads on
the Monitor object.
 
The signal(nbr:long;var remains:long) method will signal nbr of
waiting threads, but if signal() fails, the remaining number of signals
that were not signaled will be returned in the remains variable.
 
and WaitersBlocked() will return the number of waiting threads on
the Monitor object.
 
and Enter() and Leave() methods to enter and leave the monitor's Lock.
 
 
You can download the zip files from:
 
https://sites.google.com/site/scalable68/semacondvar-semamonitor
 
and the lightweight version is here:
 
https://sites.google.com/site/scalable68/light-weight-semacondvar-semamonitor
 
 
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: