Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.vms    |    DEC's VAX* line of computers & VMS.    |    264,096 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 264,005 of 264,096    |
|    =?UTF-8?Q?Arne_Vajh=C3=B8j?= to All    |
|    Re: New PHP kits available (and a progra    |
|    01 Jan 26 20:51:57    |
   
   From: arne@vajhoej.dk   
      
   (2.5 year old thread long gone from NNTP servers, but I got time   
   to look at it now)   
      
   On Jul 10, 2023, 7:59:50 PM I wrote:   
    >On 7/10/2023 1:47 PM, Mark Berryman wrote:   
    >> PHP 8.1 and later implement a new feature named fibers. It is   
    >> advertised as allowing a program running in a single thread to run   
    >> multiple threads. In reality, it simply allows one to create   
   co-routines.   
    >>   
    >> In order to implement this feature, PHP needs to be able to save and   
    >> restore execution context, as well as the ability to jump to a saved PC   
    >> location. PHP uses the boost library to implement this and the boost   
    >> library provides code in x86 assembly for the save/restore functions. I   
    >> had planned to implement similar functionality for Alpha and Integrity   
    >> using Macro32, only to discover that Macro32 doesn't provide access to   
    >> the floating point registers.   
      
    > I have never used EXE$KP_* but in a recent thread I think it   
    > was agreed that they were really a coroutine implementation.   
    > So obvious question: could they be used to implement this?   
      
   PHP is a very high level language and EXE$KP_* are a very   
   low level construct.   
      
   But they sure match pretty well.   
      
   start('ABC');   
   echo "A2 ($v)\n";   
   $v = $ctx->resume('DEF');   
   echo "A3 ($v)\n";   
   $v = $ctx->resume('GHI');   
   if($v === null) $v = $ctx->getReturn();   
   echo "A4 ($v)\n";   
      
   ?>   
      
   gives:   
      
   A1   
   B1 (ABC)   
   A2 (123)   
   B2 (DEF)   
   A3 (456)   
   B3 (GHI)   
   A4 (789)   
      
   #include
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca