Sunday, February 16, 2020

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

aminer68@gmail.com: Feb 15 04:44PM -0800

Hello,
 
 
Here is my new poem: "My love for you is deep like the Ocean !"
 
I was just listening at the following music called "The Ocean",
and i have just decided to write fast another beautiful poem of Love,
so i will invite you to listen to the following beautiful music reading at the same time my new poem of Love below:
 
https://www.youtube.com/watch?v=aI3yNckfSvU
 
 
Here is my new poem of Love:
 
 
My love for you is deep like the Ocean !
 
Because love is a beautiful devotion !
 
My love for you is deep like the Ocean !
 
Since i am coming to you like a beautiful kiss of slow motion !
 
My love for you is deep like the Ocean !
 
Since the beautiful is our locomotion !
 
My love for you is deep like the Ocean !
 
Since i am feeling your lovely emotions !
 
My love for you is deep like the Ocean !
 
Since too, with our love, i want to make a beautiful promotion !
 
My love for you is deep like the Ocean !
 
So don't ask about this or that notion !
 
My love for you is deep like the Ocean !
 
Because our love is moving fast by the Newton's first law of motion !
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 03:58PM -0800

Hello..
 
 
About Turing completeness and parallel programming..
 
You have to know that a Turing-complete system can be proven mathematically to be capable of performing any possible calculation or computer program.
 
So now you are understanding what is the power of "expressiveness" that
is Turing-complete.
 
For example i am working with the Tool that is called "Tina"(read about it below), it is a powerful tool that permits to work on Petri nets and be able to know about the boundedness and liveness of Petri nets, for example Tina supports Timed Petri nets that are Turing-complete , so the power of there expressiveness is Turing-complete, but i think this level of expressiveness is good for parallel programming and such, but
it is not an efficient high level expressiveness. But still Petri nets are good for parallel programming.
 
Read the rest to know more:
 
About deadlocks and race conditions in parallel programming..
 
I have just read the following paper:
 
Deadlock Avoidance in Parallel Programs with Futures
 
https://cogumbreiro.github.io/assets/cogumbreiro-gorn.pdf
 
So as you are noticing you can have deadlocks in parallel programming
by introducing circular dependencies among tasks waiting on future values or you can have deadlocks by introducing circular dependencies among tasks waiting on windows event objects or such synchronisation objects, so you have to have a general tool that detects deadlocks,
but if you are noticing that the tool called Valgrind for C++
can detect deadlocks only happening from Pthread locks , read
the following to notice it:
 
http://valgrind.org/docs/manual/hg-manual.html#hg-manual.lock-orders
 
So this is not good, so you have to have a general way that permits
to detect deadlocks on locks , mutexes, and deadlocks from introducing circular dependencies among tasks waiting on future values or deadlocks you may have deadlocks by introducing circular dependencies among tasks waiting on windows event objects or such synchronisation objects etc.
this is why i have talked before about this general way that detects deadlocks, and here it is, read my following thoughts:
 
Yet more precision about the invariants of a system..
 
I was just thinking about Petri nets , and i have studied more
Petri nets, they are useful for parallel programming, and
what i have noticed by studying them, is that there is two methods
to prove that there is no deadlock in the system, there is the
structural analysis with place invariants that you have to mathematically find, or you can use the reachability tree, but we have to notice that the structural analysis of Petri nets learns you more, because it permits you to prove that there is no deadlock in the system, and the place invariants are mathematically calculated by the following
system of the given Petri net:
 
Transpose(vector) * Incidence matrix = 0
 
So you apply the Gaussian Elimination or the Farkas algorithm to
the incidence matrix to find the Place invariants, and as you will
notice those place invariants calculations of the Petri nets look
like Markov chains in mathematics, with there vector of probabilities
and there transition matrix of probabilities, and you can, using
Markov chains mathematically calculate where the vector of probabilities
will "stabilize", and it gives you a very important information, and
you can do it by solving the following mathematical system:
 
Unknown vector1 of probabilities * transition matrix of probabilities = Unknown vector1 of probabilities.
 
Solving this system of equations is very important in economics and
other fields, and you can notice that it is like calculating the
invariants , because the invariant in the system above is the
vector1 of probabilities that is obtained, and this invariant,
like in the invariants of the structural analysis of Petri nets,
gives you a very important information about the system, like where
market shares will stabilize that is calculated this way in economics.
 
About reachability analysis of a Petri net..
 
As you have noticed in my Petri nets tutorial example (read below),
i am analysing the liveness of the Petri net, because there is a rule
that says:
 
If a Petri net is live, that means that it is deadlock-free.
 
Because reachability analysis of a Petri net with Tina
gives you the necessary information about boundedness and liveness
of the Petri net. So if it gives you that the Petri net is "live" , so
there is no deadlock in it.
 
Tina and Partial order reduction techniques..
 
With the advancement of computer technology, highly concurrent systems
are being developed. The verification of such systems is a challenging
task, as their state space grows exponentially with the number of processes. Partial order reduction is an effective technique to address this problem. It relies on the observation that the effect of executing transitions concurrently is often independent of their ordering.
 
Tina is using "partial-order" reduction techniques aimed at preventing
combinatorial explosion, Read more here to notice it:
 
http://projects.laas.fr/tina/papers/qest06.pdf
 
About modelizations and detection of race conditions and deadlocks
in parallel programming..
 
I have just taken further a look at the following project in Delphi
called DelphiConcurrent by an engineer called Moualek Adlene from France:
 
https://github.com/moualek-adlene/DelphiConcurrent/blob/master/DelphiConcurrent.pas
 
And i have just taken a look at the following webpage of Dr Dobb's journal:
 
Detecting Deadlocks in C++ Using a Locks Monitor
 
https://www.drdobbs.com/detecting-deadlocks-in-c-using-a-locks-m/184416644
 
And i think that both of them are using technics that are not as good
as analysing deadlocks with Petri Nets in parallel applications ,
for example the above two methods are only addressing locks or mutexes
or reader-writer locks , but they are not addressing semaphores
or event objects and such other synchronization objects, so they
are not good, this is why i have written a tutorial that shows my
methodology of analysing and detecting deadlocks in parallel applications with Petri Nets, my methodology is more sophisticated because it is a generalization and it modelizes with Petri Nets the broader range of synchronization objects, and in my tutorial i will add soon other synchronization objects, you have to look at it, here it is:
 
https://sites.google.com/site/scalable68/how-to-analyse-parallel-applications-with-petri-nets
 
You have to get the powerful Tina software to run my Petri Net examples
inside my tutorial, here is the powerful Tina software:
 
http://projects.laas.fr/tina/
 
Also to detect race conditions in parallel programming you have to take
a look at the following new tutorial that uses the powerful Spin tool:
 
https://mirrors.edge.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html
 
This is how you will get much more professional at detecting deadlocks
and race conditions in parallel programming.
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 01:40PM -0800

Hello,
 
 
Here is my next poem of Love: "Let the beautiful music play"
 
I was just listening to the following beautiful indian song,
so i have just decided to write another new poem of Love,
so i will invite you to listen to the following beautiful
indian song reading at the same time my new beautiful poem of Love below:
 
https://www.youtube.com/watch?v=EhB31Um0TFQ
 
 
I have just decided to write fast a new poem of Love, here it is:
 
 
Let the beautiful music play
 
Since i also want it your beautiful way
 
Let the beautiful music play
 
Since my poetry of love is like the beautiful song to be replayed
 
Let the beautiful music play
 
Since i want to take you beautifully in my arms without a delay !
 
Let the beautiful music play
 
Since we are like the beautiful roses for our beautiful holiday
 
Let the beautiful music play
 
Since even if time is running away
 
Let the beautiful music play
 
Since our love is here to forever stay
 
Let the beautiful music play
 
Since our beautiful love will be in everyday and in everyway
 
Let the beautiful music play
 
Since our beautiful love is like a beautiful King's reign !
 
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 01:38PM -0800

Hello,
 
 
Here is my new poem of Love: "Ooh my love you are like this beautiful rose !"
 
I was just listening to the following beautiful indian song,
so i have just decided to write another new poem of Love,
so i will invite you to listen to the following beautiful
indian song reading at the same time my new beautiful poem of Love below:
 
https://www.youtube.com/watch?v=EhB31Um0TFQ
 
 
Here is my new poem of Love:
 
 
Ooh my love you are like this beautiful rose !
 
Since you and me are the beautiful right dose
 
Ooh my love you are like this beautiful rose !
 
Since my love for you will never be an adios !
 
Ooh my love you are like this beautiful rose !
 
Since our love is a beautiful time that is not the morose
 
Ooh my love you are like this beautiful rose !
 
Since we both exist and our love predispose to the grandiose !
 
Ooh my love you are like this beautiful rose !
 
Since we are like beautiful heroes in our beautiful cosmos
 
Ooh my love you are like this beautiful rose !
 
Since our love is also like this beautiful river that flows
 
Ooh my love you are like this beautiful rose !
 
So be close to me my so beautiful rose !
 
Ooh my love you are like this beautiful rose !
 
Since our love is like peace of this beautiful white Dove !
 
Ooh my love you are like this beautiful rose !
 
Since as you see my beautiful poetry wants to beautifully expose !
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 01:25PM -0800

Hello..
 
 
About the full paper on the Swarm chip..
 
I have just read the following full PhD paper from MIT about the new Swarm chip:
 
https://people.csail.mit.edu/sanchez/papers/2015.swarm.micro.pdf
 
I think there are disadvantages with this chip, first it is
using the same mechanisms as Transactional memory, but those mechanisms
of Transactional memory are not so efficient(read below to know more), but we are already having Intel hardware Transactional memory , and i don't think it is globally faster on parallelism than actual hardware and software because look at the writing on the paper about the benchmarks and you will understand more.
 
And about Transactional memory and more read my following thoughts:
 
About Hardware Transactional Memory and my invention that is my powerful Fast Mutex:
 
"As someone who has used TSX to optimize synchronization primitives, you can expect to see a ~15-20% performance increase, if (big if) your program is heavy on disjoint data access, i.e. a lock is needed for correctness, but conflicts are rare in practice. If you have a lot of threads frequently writing the same cache lines, you are probably going to see worse performance with TSX as opposed to traditional locking. It helps to think about TSX as transparently performing optimistic concurrency control, which is actually pretty much how it is implemented under the hood."
 
Read more here:
 
https://news.ycombinator.com/item?id=8169697
 
So as you are noticing, HTM (hardware transactional memory) and TM can not replace locks when doing IO and for highly contended critical sections, this is why i have invented my following powerful Fast Mutex:
 
More about research and software development..
 
I have just looked at the following new video:
 
Why is coding so hard...
 
https://www.youtube.com/watch?v=TAAXwrgd1U8
 
 
I am understanding this video, but i have to explain my work:
 
I am not like this techlead in the video above, because i am also an "inventor" that has invented many scalable algorithms and there implementions, i am also inventing effective abstractions, i give you an example:
 
Read the following of the senior research scientist that is called Dave Dice:
 
Preemption tolerant MCS locks
 
https://blogs.oracle.com/dave/preemption-tolerant-mcs-locks
 
As you are noticing he is trying to invent a new lock that is preemption tolerant, but his lock lacks some important characteristics, this is why i have just invented a new Fast Mutex that is adaptative and that is much much better and i think mine is the "best", and i think you will not find it anywhere, my new Fast Mutex has the following characteristics:
 
1- Starvation-free
2- Good fairness
3- It keeps efficiently and very low the cache coherence traffic
4- Very good fast path performance (it has the same performance as the
scalable MCS lock when there is contention.)
5- And it has a decent preemption tolerance.
 
this is how i am an "inventor", and i have also invented other scalable algorithms such as a scalable reference counting with efficient support for weak references, and i have invented a fully scalable Threadpool, and i have also invented a Fully scalable FIFO queue, and i have also invented other scalable algorithms and there implementations, and i think i will sell some of them to Microsoft or to Google or Embarcadero or such software companies.
 
And about composability of lock-based systems now:
 
Design your systems to be composable. Among the more galling claims of the detractors of lock-based systems is the notion that they are somehow uncomposable:
 
"Locks and condition variables do not support modular programming," reads one typically brazen claim, "building large programs by gluing together smaller programs[:] locks make this impossible."9 The claim, of course, is incorrect. For evidence one need only point at the composition of lock-based systems such as databases and operating systems into larger systems that remain entirely unaware of lower-level locking.
 
There are two ways to make lock-based systems completely composable, and each has its own place. First (and most obviously), one can make locking entirely internal to the subsystem. For example, in concurrent operating systems, control never returns to user level with in-kernel locks held; the locks used to implement the system itself are entirely behind the system call interface that constitutes the interface to the system. More generally, this model can work whenever a crisp interface exists between software components: as long as control flow is never returned to the caller with locks held, the subsystem will remain composable.
 
Second (and perhaps counterintuitively), one can achieve concurrency and
composability by having no locks whatsoever. In this case, there must be
no global subsystem state—subsystem state must be captured in per-instance state, and it must be up to consumers of the subsystem to assure that they do not access their instance in parallel. By leaving locking up to the client of the subsystem, the subsystem itself can be used concurrently by different subsystems and in different contexts. A concrete example of this is the AVL tree implementation used extensively in the Solaris kernel. As with any balanced binary tree, the implementation is sufficiently complex to merit componentization, but by not having any global state, the implementation may be used concurrently by disjoint subsystems—the only constraint is that manipulation of a single AVL tree instance must be serialized.
 
Read more here:
 
https://queue.acm.org/detail.cfm?id=1454462
 
 
About deadlocks and race conditions in parallel programming..
 
I have just read the following paper:
 
Deadlock Avoidance in Parallel Programs with Futures
 
https://cogumbreiro.github.io/assets/cogumbreiro-gorn.pdf
 
So as you are noticing you can have deadlocks in parallel programming
by introducing circular dependencies among tasks waiting on future values or you can have deadlocks by introducing circular dependencies among tasks waiting on windows event objects or such synchronisation objects, so you have to have a general tool that detects deadlocks,
but if you are noticing that the tool called Valgrind for C++
can detect deadlocks only happening from Pthread locks , read
the following to notice it:
 
http://valgrind.org/docs/manual/hg-manual.html#hg-manual.lock-orders
 
So this is not good, so you have to have a general way that permits
to detect deadlocks on locks , mutexes, and deadlocks from introducing circular dependencies among tasks waiting on future values or deadlocks you may have deadlocks by introducing circular dependencies among tasks waiting on windows event objects or such synchronisation objects etc.
this is why i have talked before about this general way that detects deadlocks, and here it is, read my following thoughts:
 
Yet more precision about the invariants of a system..
 
I was just thinking about Petri nets , and i have studied more
Petri nets, they are useful for parallel programming, and
what i have noticed by studying them, is that there is two methods
to prove that there is no deadlock in the system, there is the
structural analysis with place invariants that you have to mathematically find, or you can use the reachability tree, but we have to notice that the structural analysis of Petri nets learns you more, because it permits you to prove that there is no deadlock in the system, and the place invariants are mathematically calculated by the following
system of the given Petri net:
 
Transpose(vector) * Incidence matrix = 0
 
So you apply the Gaussian Elimination or the Farkas algorithm to
the incidence matrix to find the Place invariants, and as you will
notice those place invariants calculations of the Petri nets look
like Markov chains in mathematics, with there vector of probabilities
and there transition matrix of probabilities, and you can, using
Markov chains mathematically calculate where the vector of probabilities
will "stabilize", and it gives you a very important information, and
you can do it by solving the following mathematical system:
 
Unknown vector1 of probabilities * transition matrix of probabilities = Unknown vector1 of probabilities.
 
Solving this system of equations is very important in economics and
other fields, and you can notice that it is like calculating the
invariants , because the invariant in the system above is the
vector1 of probabilities that is obtained, and this invariant,
like in the invariants of the structural analysis of Petri nets,
gives you a very important information about the system, like where
market shares will stabilize that is calculated this way in economics.
 
About reachability analysis of a Petri net..
 
As you have noticed in my Petri nets tutorial example (read below),
i am analysing the liveness of the Petri net, because there is a rule
that says:
 
If a Petri net is live, that means that it is deadlock-free.
 
Because reachability analysis of a Petri net with Tina
gives you the necessary information about boundedness and liveness
of the Petri net. So if it gives you that the Petri net is "live" , so
there is no deadlock in it.
 
Tina and Partial order reduction techniques..
 
With the advancement of computer technology, highly concurrent systems
are being developed. The verification of such systems is a challenging
task, as their state space grows exponentially with the number of processes. Partial order reduction is an effective technique to address this problem. It relies on the observation that the effect of executing transitions concurrently is often independent of their ordering.
 
Tina is using "partial-order" reduction techniques aimed at preventing
combinatorial explosion, Read more here to notice it:
 
http://projects.laas.fr/tina/papers/qest06.pdf
 
About modelizations and detection of race conditions and deadlocks
in parallel programming..
 
I have just taken further a look at the following project in Delphi
called DelphiConcurrent by an engineer called Moualek Adlene from France:
 
https://github.com/moualek-adlene/DelphiConcurrent/blob/master/DelphiConcurrent.pas
 
And i have just taken a look at the following webpage of Dr Dobb's journal:
 
Detecting Deadlocks in C++ Using a Locks Monitor
 
https://www.drdobbs.com/detecting-deadlocks-in-c-using-a-locks-m/184416644
 
And i think that both of them are using technics that are not as good
as analysing deadlocks with Petri Nets in parallel applications ,
for example the above two methods are only addressing locks or mutexes
or reader-writer locks , but they are not addressing semaphores
or event objects and such other synchronization objects, so they
are not good, this is why i have written a tutorial that shows my
methodology of analysing and detecting deadlocks in parallel applications with Petri Nets, my methodology is more sophisticated because it is a generalization and it modelizes with Petri Nets the broader range of synchronization objects, and in my tutorial i will add soon other synchronization objects, you have to look at it, here it is:
 
https://sites.google.com/site/scalable68/how-to-analyse-parallel-applications-with-petri-nets
 
You have to get the powerful Tina software to run my Petri Net examples
inside my tutorial, here is the powerful Tina software:
 
http://projects.laas.fr/tina/
 
Also to detect race conditions in parallel programming you have to take
a look at the following new tutorial that uses the powerful Spin tool:
 
https://mirrors.edge.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html
 
This is how you will get much more professional at detecting deadlocks
and race conditions in parallel programming.
 
 
About Java and Delphi and Freepascal..
 
I have just read the following webpage:
 
Java is not a safe language
 
https://lemire.me/blog/2019/03/28/java-is-not-a-safe-language/
 
 
But as you have noticed the webpage says:
 
- Java does not trap overflows
 
But Delphi and Freepascal do trap overflows.
 
And the webpage says:
 
- Java lacks null safety
 
But Delphi has null safety since i have just posted about it by saying the following:
 
Here is MyNullable library for Delphi and FreePascal that brings null safety..
 
Java lacks null safety. When a function receives an object, this object might be null. That is, if you see 'String s' in your code, you often have no way of knowing whether 's' contains an actually String unless you check at runtime. Can you guess whether programmers always check? They do not, of course, In practice, mission-critical software does crash without warning due to null values. We have two decades of examples. In Swift or Kotlin, you have safe calls or optionals as part of the language.
 
Here is MyNullable library for Delphi and FreePascal that brings null safety, you can read the html file inside the zip to know how it works, and you can download it from my website here:
 
https://sites.google.com/site/scalable68/null-safety-library-for-delphi-and-freepascal
 
 
And the webpage says:
 
- Java allows data races
 
But for Delphi and Freepascal i have just written about how to prevent data races by saying the following:
 
Yet more precision about the invariants of a system..
 
I was just thinking about Petri nets , and i have studied more
Petri nets, they are useful for parallel programming, and
what i have noticed by studying them, is that there is two methods
to prove that there is no deadlock in the system, there is the
structural analysis with place invariants that you have to mathematically find, or you can use the reachability tree, but we have to notice that the structural analysis of Petri nets learns you more, because it permits you to prove that there is no deadlock in the system, and the place invariants are mathematically calculated by the following
system of the given Petri net:
 
Transpose(vector) * Incidence matrix = 0
 
So you apply the Gaussian Elimination or the Farkas algorithm to
the incidence matrix to find the Place invariants, and as you will
notice those place invariants calculations of the Petri nets look
like Markov chains in mathematics, with there vector of probabilities
and there transition matrix of probabilities, and you can, using
Markov chains mathematically calculate where the vector of probabilities
will "stabilize", and it gives you a very important information, and
you can do it by solving the following mathematical system:
 
Unknown vector1 of probabilities * transition matrix of probabilities = Unknown vector1 of probabilities.
 
Solving this system of equations is very important in economics and
other fields, and you can notice that it is like calculating the
invariants , because the invariant in the system above is the
vector1 of probabilities that is obtained, and this invariant,
like in the invariants of the structural analysis of Petri nets,
gives you a very important information about the system, like where
market shares will stabilize that is calculated this way in economics.
 
About reachability analysis of a Petri net..
 
As you have noticed in my Petri nets tutorial example (read below),
i am analysing the liveness of the Petri net, because there is a rule
that says:
 
If a Petri net is live, that means that it is deadlock-free.
 
Because reachability analysis of a Petri net with Tina
gives you the necessary information about boundedness and liveness
of the Petri net. So if it gives you that the Petri net is "live" , so
there is no deadlock in it.
 
Tina and Partial order reduction techniques..
 
With the advancement of computer technology, highly concurrent systems
are being developed. The verification of such systems is a challenging
task, as their state space grows exponentially with the
aminer68@gmail.com: Feb 15 01:12PM -0800

Hello..
 
 
My GUI components for Delphi and Freepascal are here..
 
Please execute the programs inside my zip file of my Winmenus using Wingraph
to see how it look like.
 
Why am i implementing GUI components and the process by wich
you organize them into a more interesting and interactive GUI applications ?
 
You can still use Qt GUI libraries or the like , but what
i am doing is "learning" the Delphi and FreePascal community
how to design and to implement the following GUI components
with simple primitives of Wingraph that is like the graph
unit of Turbo Pascal:
 
- Button
- Label
- TextBox
- MessageBox
- Memo
- Panel
- RadioButton
- CheckBox
- ProgressBar
- TreeMenu
- Calendar
 
You have to know that "using" GUI libraries is much easier
but to be able to understand the "inside" of how to
implement sophisticated GUI components from
simple graphical primitives is better and is good to know.
 
About my next TreeMenu GUI component, i think i will also implement soon and easily a TreeMenu component, that is like TreeView but it is constituted with two of my Winmenus and with my StringTree, i think you will appreciate it because it will be "powerful" because it will use a much enhanced version of my Winmenus.
 
More explanation of the GUI components..
 
Now the following GUI components are supported:
 
- Button
- Label
- TextBox
- MessageBox
- CheckBox
- Winmenus
 
 
I will soon add a more powerful GUI component called TreeMenu,
it will look like the GUI of a file manager, but you will
be able to click on the callbacks and to search etc.
 
Also i will soon provide you with a calendar GUI component and with a checkbox component.
 
I have corrected a small bug in the event loop, now i think all is working correctly, and i think my units are stable, here is the units that have included inside the zip file of my new Winmenus version 1.23: so i have included the my Graph3D unit for 3D graphism that looks like the graph unit of turbo pascal, and i have included my enhanced Winmenus GUI component using wingraph, and i have included the GUI unit that contains the other GUI components, and of course i have included Wingraph that look like the graph unit of Turbo Pascal but it is for Delphi and FreePascal.
 
About my software project..
 
As you have noticed i have extended the GUI components using Wingraph, now i have added a checkbox GUI component, now here is the GUI components that are supported:
 
- Button
- Label
- TextBox
- MessageBox
- CheckBox
- Winmenus
 
 
But i think that the Memo GUI component can be "emulated" with my Winmenus GUI component, so i think that my Winmenus GUI component is powerful and i think it is complete now, and i will soon add a more powerful GUI component called TreeMenu that will look like the GUI of a file manager, but you will be able to click on the callbacks and to search etc. it will be implemented with two of my Winmenus and with my powerful StringTree here:
 
sites.google.com/.../stringtree
 
 
And soon i will also implement a Calendar GUI component and
a ProgressBar GUI component.
 
But you have to understand me , i am implementing those
GUI components so that you will be able to design and implement
more interactive GUI applications for graphical applications
with Wingraph and such.
 
 
You can download Winmenus using wingraph that contains all the units
above that i have implemented from:
 
https://sites.google.com/site/scalable68/winmenus-using-wingraph
 
 
I have also implemented the text mode WinMenus, here it is:
 
 
Description
 
Drop-Down Menu Widget using the Object Pascal CRT unit
 
Please look at the test.pas example inside the zip file Use the 'Delete' on the keyboard to delete the items
and use the 'Insert' on the keyboard to insert the items
and use the 'Up' and 'Down' and 'PageUp and 'PageDown' to scroll .. and use the 'Tab' on the keyboard to switch between the Drop Down Menus and 'Enter' to select an item..
and the 'Esc' on the keyboard to exit..
and the 'F1' on keyboard to delete all the items from the list
right arrow and left arrow to scroll on the left or on the right
You can search with SearchName() and NextSearch() methods and now the search with wildcards inside the Widget is working perfectly.
 
Winmenus is event driven, i have to explain all to you to understand more...
 
At first you have to create your Widget menu by executing something like this:
 
Menu1:=TMenu.create(5,5);
 
This will create a Widget menu at the coordinate (x,y) = (5,5)
 
After that you have to set your callbacks,cause my Winmenus is event driven, so you have to do it like this:
 
Menu1.SetCallbacks(insert,updown);
 
The SetCallbacks() method will set your callbacks, the first callback parameter is the callback that will be executed when the insert key is pressed and it is the insert() function, and the second callback is the callback that will be called when the up and down keys are pressed and it is the function "updown" , the remaining callbacks that you can assign are the following keys: Delete and F1 to F12.
 
After that you can add your items and the callbacks to the Menu by calling the AddItem() method like this:
 
Menu1.AddItem(inttostr(i),test1);
 
the test1 is a callback that you add with AddItem() method.
 
After that you will enter a loop like this , the template of this loop must look like the following, that's
not difficult to understand:
 
Here it is:
 
===
repeat
 
textbackground(blue);
clrscr;
menu2.execute(false);
menu1.execute(false);
 
case i mod 2 of
 
1: ret:=Menu1.Execute(true);
0: ret:=Menu2.Execute(true);
end;
if ret=ctTab then inc(i);
 
until ret=ctExit;
 
menu1.free;
menu2.free;
 
end.
 
==
 
When you execute menu1.execute(false), with a parameter equal to false, my Winmenus widget will draw your menu without waiting for your input and events, when you set the parameter of the execute() method to true it will wait for your input and events, if the parameter of the execute method is true and the returned value of the execute method is ctTab, that means you have pressed on the Tab key, and if the returned value is ctExit, that means you have pressed on the Escape key to exit.
 
 
You can download my text mode Winmenus from:
 
https://sites.google.com/site/scalable68/winmenus
 
And my units are working with Delphi and FreePascal and C++Builder.
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 12:37PM -0800

Hello,
 
 
My Scalable reference counting with efficient support for weak references was updated to version 1.38
 
You can download it from my website here:
 
https://sites.google.com/site/scalable68/scalable-reference-counting-with-efficient-support-for-weak-references
 
 
Thank you,
Amine Moulay Ramdane
aminer68@gmail.com: Feb 15 12:22PM -0800

Hello,
 
 
Embarcadero Launches LearnDelphi.org ...
 
As you have noticed , i am also programming in Delphi and Freepascal,
and now i will invite you to read the following news about Delphi:
 
Embarcadero Launches LearnDelphi.org, a Delphi-Centric Learning Ecosystem, to Promote Delphi Education
 
Read more here:
 
https://apnews.com/Business%20Wire/0524383998734d05a34d5900fdfa0058
 
And here is the new website of LearnDelphi.org:
 
https://www.learndelphi.org/
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 12:15PM -0800

Hello,
 
 
More about Delphi..
 
As you have noticed i am also using Delphi and Freepascal,
so read the following to know more about Delphi:
 
Delphi for iOS and Android: The Natives are restless
 
Delphi's Strengths and Weaknesses
 
So what does all this mean for developers? It means that Delphi has its strengths and weaknesses, and as long as you are aware of them, you can choose Delphi for the right jobs.
 
If you need cross-platform compatibility and want to deal with only one code base (mostly), Delphi is an excellent choice. It provides nice abstractions of the OS and its services, a relatively pretty GUI library, and native (very fast) access to the CPU. Delphi also has excellent DB connectivity, web services connectivity, and networking in general. This means Delphi is a good choice for:
 
- Enterprise developers, who want to provide mobile access and don't really care about pixel-perfect look and feel
 
- Scientific and number crunching developers, who need fast processing and a way to nicely display their results
 
- Game developers, surprisingly enough, who want to develop cross-platform games which don't have "native" interfaces anyway and where FMX can provide fast-enough graphics. (In other words, not Madden level graphics but Angry Birds).
 
- "Light" Apps which don't use a bazillion controls to interact with the user and don't need "pixel-perfect" responsiveness
 
- Compelling apps where the user will forgive some idiosyncrasies because the app is so good. I mention this because Delphi allows you to concentrate on the app. Delphi provides the RAD and the cross-platform compatibility, you can concentrate on making the killer app.
 
Read more here:
 
http://riversoftavg.com/blogs/index.php/2013/09/28/delphi-for-ios-and-android-the-natives-are-restless/
 
Pascal still an advantage for some iOS, Android developers
 
Many developers wouldn't dream of developing in Delphi with iOS or Android in mind, but with cross-platform compilers, companies sitting on years of solid code may suddenly find themselves with a second wind.
 
Read more here:
 
https://www.zdnet.com/article/pascal-still-an-advantage-for-some-ios-android-developers/
 
NASA is also using Delphi, read about it here:
 
https://community.embarcadero.com/blogs/entry/want-moreexploration-40857
 
 
The European Space Agency is also using Delphi, read about it here:
 
https://community.embarcadero.com/index.php/blogs/entry/delphi-s-involvement-with-the-esa-rosetta-comet-spacecraft-project-1
 
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 10:07AM -0800

Hello,
 
 
Here is my new variants of Scalable RWLocks that are powerful..
 
Author: Amine Moulay Ramdane
 
Description:
 
A fast, and scalable and starvation-free and fair and lightweight Multiple-Readers-Exclusive-Writer Lock called LW_RWLockX, the scalable LW_RWLockX does spin-wait, and also a fast and scalable and starvation-free and fair Multiple-Readers-Exclusive-Writer Lock called RWLockX, the scalable RWLockX doesn't spin-wait but uses my portable SemaMonitor and portable event objects , so it is energy efficient.
 
The parameter of the constructors is the size of the array of the readers , so if the size of the array is equal to the number of parallel readers, so it will be scalable, but if the number of readers are greater than the size of the array , you will start to have contention, please look at the source code of my scalable algorithms to understand.
 
 
I have used my following hash function to make my new variants of RWLocks scalable:
 
---
 
function DJB2aHash(key:int64):uint64;
var
i: integer;
key1:uint64;
 
begin
Result := 5381;
for i := 1 to 8 do
begin
key1:=(key shr ((i-1)*8)) and $00000000000000ff;
Result := ((Result shl 5) xor Result) xor key1;
end;
end;
 
---
 
You can download them from:
 
https://sites.google.com/site/scalable68/new-variants-of-scalable-rwlocks
 
 
Thank you,
Amine Moulay Ramdane.
aminer68@gmail.com: Feb 15 08:22AM -0800

Hello,
 
 
EasyList was updated to version 1.31
 
Now the parallel sorting algorithm is working on both ascending and descending order.
 
About my EasyList now..
 
As you have noticed i have quickly in 1 day wrote 600 lines of new Delphi code of EasyList, and i have corrected the bugs in one more day, so in two days i have provided you with my EasyList that i think is stable and fast, and i have decided to write an EasyList with generics for Freepascal , it is now at version 1.31, but i think that EasyList for Delphi and Freepascal is much more "general", so you can look at the source code since i have provided you with it.
 
You can download my new EasyList for Delphi and Freepascal version 1.31 from:
 
https://sites.google.com/site/scalable68/easylist-for-delphi-and-freepascal
 
And you can download my new EasyList with generics for Freepascal version 1.3 from:
 
https://sites.google.com/site/scalable68/easylist-with-generics-for-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: