Recent

Author Topic: Pascal feature proposal: begin(syncObj)  (Read 11276 times)

bylaardt

  • Sr. Member
  • ****
  • Posts: 309
Re: Pascal feature proposal: begin(syncObj)
« Reply #15 on: July 30, 2015, 04:26:58 pm »
ok, but in theory i can't see relevant differences between your async and
Code: [Select]
procedure ICanWait;
begin
  for a:=1 to 100000 do
    DoSomething;
end;
procedure DoSomething
begin
  while {condition} do
    begin
      MoreSomethings;
      application.processmessages;
    end
end;
Maybe Async compile uncontrolled processmessages in every places...

PS: IMHO, in C (and others like C languages) and VB async have no relevance without await.

The syntax is not confuse... Confuse is the moment when others OS Messages must be called to not freeze your application.
ignoring syntax, what async realy do?
if the answer is "prevet freeze" then is confusing because application.processmessages do it too and you have the control when the interrupt must occurs.
if the answer is "paralel processing" then is more confusing because async runs over the same application thread!

Basile B.

  • Guest
Re: Pascal feature proposal: begin(syncObj)
« Reply #16 on: July 31, 2015, 03:18:39 pm »
To make it more versatile (not only dedicated to TCriticalSection, which the compiler doesn't know BTW, it's a library type... ;) ), I'd see more this as an operator that could be overloaded for a particular type, for example:
Without try/finally it's pretty useless (unless end operator is always executed).
Also such generic approach doesn't allow optimization: compiler will always generate code even if it's redundant.

Not true, such a construct is a template. It means that it got to be expanded to build the AST. From far before the optimization phase.

JorgeAldo

  • New Member
  • *
  • Posts: 11
Re: Pascal feature proposal: begin(syncObj)
« Reply #17 on: July 31, 2015, 08:16:04 pm »
we need aspect oriented programming extensions.

 

TinyPortal © 2005-2018