gpgme and multithreading

Stéphane Corthésy stephane at sente.ch
Sun Jun 22 12:24:02 CEST 2003


Hi,

I'd like to use the asynchronous calls of gpgme, but I wouldn't like to 
have to implement the IO callbacks; not so easy on OSX, at first sight. 
I thought about that other strategy, and wonder if that would be safe.

- All calls made to contexts/data/etc are done in the main thread
- in a secondary thread, I invoke gpgme_wait(NULL, statusPtr, 1) - 
blocking call; when call returns, I pass information in the main thread 
to handle results. In the secondary thread, IF there are some async 
calls that have been made on contexts, then I invoke again 
gpgme_wait(), else thread is blocked (semaphore) until an async call is 
done.

Would this be safe with gpgme?


Stéphane





More information about the Gnupg-devel mailing list