RSS/Atom feed Twitter
Site is read-only, email is disabled

Gimp Perl and thread safe resources

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Gimp Perl and thread safe resources Jared Whiting 28 Sep 00:25
  Gimp Perl and thread safe resources Sven Neumann 28 Sep 00:57
Jared Whiting
2004-09-28 00:25:16 UTC (over 19 years ago)

Gimp Perl and thread safe resources

I am working on a Gimp Perl application and wanted to confirm what is available in terms of ensuring the thread-safety of the resources my Gimp scripts are using. I had read that certain resources such as current foreground/background color and brush shape are not thread-safe. I know that there is a gimp:lock() function for exclusive access to the Gimp instance that is available and had also read about the possibility of each script running in its own "GimpContext" as an alternative method.

I have implemented Gimp:lock in my scripts and it seems to lock the gimp instance for the duration of the lock call within the script thereby avoiding thread-safety issues, though I would prefer to not have to implement a lock and would like to be able to depend on each script operating with its own background color, etc.

Is there the ability currently in Gimp Perl to set it up so that each script runs in its own context?

TIA,

Jared

_________

Sven Neumann
2004-09-28 00:57:30 UTC (over 19 years ago)

Gimp Perl and thread safe resources

Hi,

"Jared Whiting" writes:

Is there the ability currently in Gimp Perl to set it up so that each script runs in its own context?

Very latest GIMP from CVS has a GimpContext API that allows plug-ins and scripts to run in their own context. These are PDB calls so it should be available in gimp-perl either immidiately or with minimal effort. I don't know enough about gimp-perl to say for sure. This functionality has only just been added to CVS, don't look for it in any released versions.

Sven