develooper Front page | perl.perl5.porters | Postings from August 2021

Re: concurrency list (was Re: Relinquishing Maintenance of CoreModules)

Thread Previous | Thread Next
David Christensen
August 3, 2021 05:40
Re: concurrency list (was Re: Relinquishing Maintenance of CoreModules)
Message ID:
On 8/2/21 9:14 PM, Yuki Kimoto wrote:
> 2021-8-3 12:05 David Christensen <> wrote:
>> On 8/2/21 7:20 PM, Yuki Kimoto wrote:


> I'm sorry for introducing my personal development.

Thank you for introducing SPVM.  :-)

>> At a glance, SPVM looks like an alternative to Perl XS
> Yes. SPVM is a language transpiler to C.


>> Does SPVM support concurrency in any form(s)?
> First concurrency support is easy to implement C openmp binding.


I would like to understand the first concurrency example, and will hold 
off on the second example and remainder of your reply for now.  Please 
bring the removed ideas back into the conversation if and when it makes 

Looking at:

I see:

- lib/MyOpenMP.c => contains C source code:

   - int32_t SPNATIVE__MyOpenMP__sum_vec_int(...) {...} => defines a 
SPVM native function in the package "MyOpenMP" with function name 

   - #pragma omp parallel for => enables OpenMP parallelization of the 
following "for" loop

- lib/MyOpenMP.spvm => contains SPVM source code:

   - package MyOpenMP => sets the package namespace

   - sub test : void () {...} => defines the package "MyOpenMP" function 

- lib/MyOpenMP.conf => contains SPVM transpiler configuration settings

- => contains Perl source code:

   - use SPVM 'MyOpenMP' => imports the package "MyOpenMP" created by 
the SPVM transpiler (presumably via EUMM or MB)

   - MyOpenMP->test => invokes the class "MyOpenMP" method "test"

So, SPVM deals with several intermediate layers between OpenMP 
concurrency and the Perl script:

- pragmatized C "for" loop

- C function "SPNATIVE__MyOpenMP__sum_vec_int"

- SPVM function "MyOpenMP::sum_vec_int"

- SPVM function "MyOpenMP::test"

Is there a way to eliminate one or more intermediate layers?

- Calling MyOpenMP::sum_vec_int() from Perl?

- Putting "#pragma omp parallel for" above a Perl "for" loop?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About