List Info

Thread: threadsafe?




threadsafe?
user name
2007-02-13 06:32:09
Hi Guys,

I'd just like to know if libgpgme when used to check S/MIME
Signatures is 
threadsafe from within an application when several threads
may check using 
the same engine and database and whatever but each thread
got it's own

gpgme_ctx_t _ctx;

gpgme_new(&_ctx));

and

gpgme_release(_ctx);

after use.
That should mean, that each of those contexts is only used
once and released 
afterwards.
There are no data structures I could see that are shared
among the threads. 
Could the still be a problem when several threads use the
lib simultaneously 
or does the context capsule it sufficiently?

Thanks for your help and greetings...

Stephan


_______________________________________________
Gnupg-devel mailing list
Gnupg-develgnupg.org
h
ttp://lists.gnupg.org/mailman/listinfo/gnupg-devel

Re: threadsafe?
country flaguser name
Germany
2007-02-16 15:51:01
At Tue, 13 Feb 2007 13:32:09 +0100,
Stephan Menzel <smenzelgmx-gmbh.de> wrote:
> 
> [1  <multipart/signed (7bit)>]
> [1.1  <text/plain; us-ascii (quoted-printable)>]
> Hi Guys,
> 
> I'd just like to know if libgpgme when used to check
S/MIME Signatures is 
> threadsafe from within an application when several
threads may check using 
> the same engine and database and whatever but each
thread got it's own
> 
> gpgme_ctx_t _ctx;
> 
> gpgme_new(&_ctx));
> 
> and
> 
> gpgme_release(_ctx);
> 
> after use.
> That should mean, that each of those contexts is only
used once and released 
> afterwards.
> There are no data structures I could see that are
shared among the threads. 
> Could the still be a problem when several threads use
the lib simultaneously 
> or does the context capsule it sufficiently?

The idea is that GPGME is thread safe in the sense that it
should be
safe to use different GPGME objects in different threads at
the same
time.  If you want to access the same GPGME objects in
different
threads, you are responsible for the necessary
synchronization.  This
extends to GPGME contexts as well as GPGME data objects and
other
objects (keys, etc).

If you have suggestions how to make this more clear in the
manual,
please let me know.

That's the concept.  There may be bugs, as this is not well
tested.
Heading over to your other mails on the subject...

Thanks,
Marcus



_______________________________________________
Gnupg-devel mailing list
Gnupg-develgnupg.org
h
ttp://lists.gnupg.org/mailman/listinfo/gnupg-devel

Re: threadsafe?
user name
2007-02-18 06:04:24
Hi Marcus,

Am Freitag, 16. Februar 2007 22:51:01 schrieb Marcus
Brinkmann:
> The idea is that GPGME is thread safe in the sense that
it should be
> safe to use different GPGME objects in different
threads at the same
> time.  If you want to access the same GPGME objects in
different
> threads, you are responsible for the necessary
synchronization.  This
> extends to GPGME contexts as well as GPGME data objects
and other
> objects (keys, etc).

OK. This is you I understood it.

> If you have suggestions how to make this more clear in
the manual,
> please let me know.

Well it appears you already did. The last time I consulted
the manual because 
of this was quite long ago and it wasn't so clear back
then.
Meanwhile I looked it up and it is a lot better now. Just
wanted to make sure 
since I got those weird problems.

Greetings...

Stephan

_______________________________________________
Gnupg-devel mailing list
Gnupg-develgnupg.org
h
ttp://lists.gnupg.org/mailman/listinfo/gnupg-devel

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )