Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Here is how to implement pure functions of Haskel and Lisp in C++..

6 views
Skip to first unread message

Ramine

unread,
Dec 2, 2016, 4:04:17 PM12/2/16
to
Hello..........

Here is how to implement pure functions of Haskel and Lisp in C++..

Firt you have to call a constructor that will put the global variables
as pointers for example in there respective queues..

And after that each method that wants to access a global variable will
take the global variable from the queue and copy it in a local
variable and work with it locally, and after that it will put
it back in its global queue , it's like message passing and
it's like pure functions with Mvars in Haskel and this mechanism is good
and will avoid race conditions in Object oriented programming.


For Deadlocks use this:

Use Lock Hierarchies to Avoid Deadlock

http://www.drdobbs.com/parallel/use-lock-hierarchies-to-avoid-deadlock/204801163


Thank you,
Amine Moulay Ramdane.
0 new messages