Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #4304

To standard or not to standard ?

From Sky89 <Sky89@sky68.com>
Newsgroups comp.programming.threads
Subject To standard or not to standard ?
Date 2018-05-19 18:48 -0400
Organization A noiseless patient Spider
Message-ID <pdq9k6$40r$2@dont-email.me> (permalink)

Show all headers | View raw


Hello..


To standard or not to standard ?

I think you know me more today, so we have to be more smart..

So my question of today has come to me from the fact that
modern Object Pascal of Delphi and FreePascal that is much powerful than 
pascal is not a standard like C++ or ADA. So an important question
from this fact arises: Is it so problematic to not have a standard like 
this ? I think that we have to be frank and be more smart, because
i think that making a standard is a slower process and it can be an not 
an efficient process, because this can be: not everything in the 
standard is efficient.. so the standard in itself can be not efficient, 
i give you an example so that you will understand me:

Look at this algorithm that is not scalable:

A more scalable reader/writer lock, and a bit less harsh consideration 
of the idea

http://joeduffyblog.com/2009/02/20/a-more-scalable-readerwriter-lock-and-a-bit-less-harsh-consideration-of-the-idea/


And look at my "scalable" algorithms of my scalable RWLocks here:

https://sites.google.com/site/aminer68/scalable-rwlock


As you have noticed that i am using Intel and AMD CPUID by by writing 
assembler on my scalable algorithms like this to get the processor number:

function GetCurrentProcessorNumber:long;
asm
{$IFDEF CPU32}
    push ebx
    mov eax, 1
    CPUID
    shr ebx, 24
    mov eax, ebx
    pop ebx
{$ENDIF CPU32}
{$IFDEF CPU64}
    push rbx
     mov rax, 1
    cpuid
    shr rbx, 24
    mov rax, rbx
    pop rbx
   {$ENDIF CPU64}
end;



So as you have noticed this is not a standard way , but it is an 
efficient way that makes my scalable algorithms "scalable",
so as you have noticed if i have wanted to make it standard,
i have to use for example the Thread ID "modulo" the number of cores
,
but this will make my algorithms less efficient and not scalable,
this is why i will say that making standards (like C++) is a slow
process and it can be not efficient.


This is why i love modern Object Pascal of Delphi and FreePascal,
because even if they are not standards , they can evolve
rapidly to change and for example there libraries can be implemented 
efficiently, this is why i love them.

Also:

I think i will also continu to work more with Delphi and FreePascal and 
Lazarus, all of them use a "modern" Object Pascal that is much more 
powerful than pascal.

Delphi for example works on the following platforms:

Windows
Linux
macOS
iOS
Android


You have to look at the new Delphi here, it is very powerful:

https://www.embarcadero.com/products/delphi


Lazarus and FreePascal are very interesting to use, you have to look
at Lazarus here to notice it:

https://www.lazarus-ide.org/


What i love in Delphi and FreePascal and Lazarus is that
Delphi and FreePascal like ADA come with range checking and Run-time 
checks that catch conversion from negative signed to unsigned , and 
catch out-of-bounds indices of dynamic and static arrays and catch 
arithmetic overflow etc. and you can also dynamically catch this 
exception of ERangeError etc. and that's good for reliability.

But C++ and C don't have range checking etc. so that's not good in C++ 
and C and that's not good for reliability and it is not good for 
safety-critical systems.


This is why i will also to continu to work more with Delphi and 
FreePascal and Lazarus, and my Delphi projects can be used with C++Builder.

Look for example at my last invention , here is my last invention for 
Delphi and FreePascal:

Scalable reference counting with efficient support for weak references

https://sites.google.com/site/aminer68/scalable-reference-counting-with-efficient-support-for-weak-references

You can find my other "inventions"(that are my scalable algorithms etc.) 
  and my other projects here:

https://sites.google.com/site/aminer68/

Also you can improve strict-type safety(and thus reliability) in Delphi 
and FreePascal with variants like this:

-- 

program test;

uses VARIANTS,SYSUTILS;

var f:double;
      a:integer;



FUNCTION ASSIGN(a,B:VARIANT):VARIANT;

begin

IF VARTYPE(A)=VARTYPE(B) THEN
BEGIN
A:=B;
RESULT:=A;
END
ELSE RAISE EXCEPTION.CREATE('ASSIGNEMENT NOT OK');


end;

begin

a:=2;

f:=a;

A:=ASSIGN(F,A);


end.
-- 


Here is the Vartype function:

http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Variants_VarType.html




Thank you,
Amine Moulay Ramdane.






Back to comp.programming.threads | Previous | Next | Find similar | Unroll thread


Thread

To standard or not to standard ? Sky89 <Sky89@sky68.com> - 2018-05-19 18:48 -0400

csiph-web