Simultaneous Multiprocessing and Multithreading in GIMP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Simultaneous Multiprocessing and Multithreading in GIMP

Developers mailing list
Hi,
AFAIK, gimp is a multiprocess program. Because for each plugin, it creates
a new process. It also uses multithreading. But, AFAIK, using fork and
multithreading is not recommended (e.g., look at the second answer here, Is
it safe to fork from within a thread?
<https://stackoverflow.com/questions/6078712/is-it-safe-to-fork-from-within-a-thread>).
How does gimp manage that?
Regards.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: Simultaneous Multiprocessing and Multithreading in GIMP

Liam R E Quin
On Sat, 2019-10-26 at 15:30 +0330, Ahmad Nouralizadeh via gimp-
developer-list wrote:
>  AFAIK, using fork
> and multithreading is not recommended (e.g., look at the second
> answer here, Is it safe to fork from within a thread?

It's “not recommended” in the same way that using a knife to cut your
meat is not recommended: you could hurt yourself.

As you can see from that stackoverflow question, there can be problems
if you don't call exec() right away in the child process after a
fork(). Which GIMP does, avoiding the problems.

This is why GIMP does not deadlock when you run a plugin.

slave liam (ankh)


--
Liam Quin - web slave for https://www.fromoldbooks.org/
with fabulous vintage art and fascinating texts to read.
Click here to have the slave beaten.

_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: Simultaneous Multiprocessing and Multithreading in GIMP

Developers mailing list
Hi Liam,
Thanks for the answer.

On Sat, 26 Oct 2019 at 16:25, Liam R E Quin <[hidden email]> wrote:

> On Sat, 2019-10-26 at 15:30 +0330, Ahmad Nouralizadeh via gimp-
> developer-list wrote:
> >  AFAIK, using fork
> > and multithreading is not recommended (e.g., look at the second
> > answer here, Is it safe to fork from within a thread?
>
> It's “not recommended” in the same way that using a knife to cut your
> meat is not recommended: you could hurt yourself.
>
> As you can see from that stackoverflow question, there can be problems
> if you don't call exec() right away in the child process after a
> fork(). Which GIMP does, avoiding the problems.
>
> This is why GIMP does not deadlock when you run a plugin.
>
> slave liam (ankh)
>
>
> --
> Liam Quin - web slave for https://www.fromoldbooks.org/
> with fabulous vintage art and fascinating texts to read.
> Click here to have the slave beaten.
>
>
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list