This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: dlmopen with RTLD_GLOBAL
- From: Toebs Douglass <toby at winterflaw dot net>
- To: libc-help at sourceware dot org
- Date: Fri, 30 Jun 2017 23:58:27 +0200
- Subject: Re: dlmopen with RTLD_GLOBAL
- Authentication-results: sourceware.org; auth=none
- References: <CAJ9X=kbxVUyf5DzZMPvkpTkehWEfeoirNNJcGMNb6Lvv98tHNA@mail.gmail.com> <fb221449-a68e-5aed-8b2d-815cc0fcad88@redhat.com> <CAJ9X=kZndr5kYoLUpp7-g+ffeCo-fXgSXEHLn1vEV=bgFnWX1Q@mail.gmail.com>
On 30/06/17 23:52, Elliott Slaughter wrote:
> Python supports threads, but getting actual speedups out of parallel
> Python programs can be a challenge. Python uses a global interpreter
> lock (GIL) that makes the interpreter thread-safe in a very coarse
> grained way. The GIL effectively prevents Python from executing
> multiple Python instructions in parallel, and can prevent Python codes
> from achieving parallel speedups. In practice, the GIL might or might
> not be an issue depending on the workload. For example, Python code
> that calls C/C++ will release the GIL for the duration of the foreign
> call. But because I'm dealing with user-supplied scripts, I can't
> guarantee that all code will be written in a way that avoids use of
> the GIL, and I'd still like that code to achieve reasonable speedups.
What happens while the GIL is held? *why* is the GIL held?
I heard some talk of replacing the GIL with lock-free data structures.
Unfortunately, I've not yet had time to implement a lock-free balanced
btree, which would of all data structures be the most likely to be
useful. However, I could get a singly-linked list going in the near
future. It would be algorithmically poor, but it would in terms of
parallelism be excellent.