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


Groups > comp.lang.python > #108630

Re: Calling python from C with OpenMP

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Calling python from C with OpenMP
Date 2016-05-13 19:09 -0700
Organization A noiseless patient Spider
Message-ID <87inyh2xw3.fsf@jester.gateway.pace.com> (permalink)
References (4 earlier) <4cb4d566-709d-1139-b515-2eb3cdbbbc9a@mrabarnett.plus.com> <mailman.637.1463159537.32212.python-list@python.org> <2a0461ad-fd4c-4ffa-9a4a-b1bf2a21b6cf@googlegroups.com> <0nqcjbh34gb68vpp9nchi9vl4mqq6qgn2g@4ax.com> <mailman.656.1463184279.32212.python-list@python.org>

Show all headers | View raw


Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
> 	It's been tried -- but the non-GIL implementations tend to be
> slower at everything else.

Has Micropython been compared?  CPython needs the GIL because of its
frequent twiddling of reference counts.  Without the GIL, multi-threaded
CPython would have to acquire and release a lock whenever it touched a
refcount, which slows things down badly.

MicroPython uses a tracing garbage collector instead of refcounts, so
there's no issue of having to lock refcounts all the time.  It's fairly
common in such systems to stop all the user threads during GC, but they
can happily run in parallel the rest of the time.  

Come to think of it, I don't know if MicroPython currently supports
threads at all!  But its implementation style (i.e. no refcounts) is
more parallelism-friendly than CPython's.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Calling python from C with OpenMP oysteijo@gmail.com - 2016-05-12 12:28 -0700
  Re: Calling python from C with OpenMP Sturla Molden <sturla.molden@gmail.com> - 2016-05-13 00:04 +0000
    Re: Calling python from C with OpenMP Øystein Schønning-Johansen <oysteijo@gmail.com> - 2016-05-13 09:22 -0700
      Re: Calling python from C with OpenMP MRAB <python@mrabarnett.plus.com> - 2016-05-13 18:12 +0100
        Re: Calling python from C with OpenMP Øystein Schønning-Johansen <oysteijo@gmail.com> - 2016-05-13 13:16 -0700
          Re: Calling python from C with OpenMP Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-05-13 20:04 -0400
            Re: Calling python from C with OpenMP Paul Rubin <no.email@nospam.invalid> - 2016-05-13 19:09 -0700

csiph-web