Subject: c-client function calls are synchronized?

From: Feiyu Xie <[email-masked]>
Date: Tue, 13 Aug 2002 13:53:03 -0400

Hi all, 
Apologize if the questions is duplicated. I'm working on a program that need
a IMAP client. I want it to be asynchronized (non-blocking network I/O) and
single threaded. i.e. there will be a loop does some sort of event polling,
and event will get dispatched in some way. 

I don't see such a polling function in c-client, and when I look at the code
in imap4r1.c, seems to me the code will send a request, wait for the reply,
parse it and then call back to main program. All these are done
sequentially. 

For instance, when imap_lsub gets called, it will call imap_list_work which
will call imap_send to send the request, and read the reply and calls
mm_lsub right in the function. 

So my question is: when using IMAP,  does a call to mail_lsub will not
return until the result is returned from the IMAP server? Is there a way to
do this in a non-blocking, asynchronized manner? 

thanks in advance!
--Feiyu Xie
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: "Peter Derr" <[email-masked]>
Date: Tue, 13 Aug 2002 15:15:46 -0400

I don't know the answer to The previous question ("c-client function calls
are synchronized?"), but it reminds me of a related question.  Is c-client
thread-safe?  I'll guess the answer to both questions is "no," based on the
static data I see.

I'm wondering because PHP can be built with the c-client library to provide
IMAP client capabilities.  Apache 2.0 is muti-threaded, with each apache
process handling multiple requests, each in a different thread.  Is this
going to lead to problems with webmail applications like IMP?

Peter

---

From: Mark Elvers <[email-masked]>
Date: Tue, 13 Aug 2002 23:28:15 +0100 (BST)

> thread-safe?  I'll guess the answer to both questions is "no," based on the

Peter, I've read comment on this group before that c-client is thread
safe.  Furthermore, I have written a threaded application using c-client
without problem.  The global static data is fine.

--mte