Hi,

I am (still) using imap2004-g and I am developing a multi-thread mail client on top of c-client.

I am having a threading issue with env_init(). In my understanding, c-client is supposed to be thread safe but might be calling some non-thread safe c library functions. I did took care of the non-tread safe c calls and there are not the problem.

My problem is that my application can have several threads (all connected to different IMAP server) which do a mail_sub potentially at the same time which cause c-client to generate a fatal error and abort. The threading issue is with the global variable myUserName (and potentially myHomeDir) which the env_init() function use to detect if it has already been called.

First I am not sure why c-client want to get access to the user home directory, it's apparently to cache on disk some information about subscribed folders, but is it really necessary? can I prevent that?

About the threading issue, maybe I can force the env_init function to get called when I initialize the c-client's drivers before I spin out the other threads or maybe I should just set myUserName and myHomeDir using env_parameters(SET_USERNAME, xxx) and parameters(SET_HOMEDIR, xxx). I am not sure what's the best solution!

Any suggestion?

Thanks for your help,
Jean-François Ducarroz

_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to