Subject: A note on multiprocess IMAP server

From: "Alex Shvedov" <[email-masked]>
Date: Thu, 4 Mar 1999 19:05:36 -0500

FYI...

For some reason I had to make my IMAP server multiprocess (as opposed to
multithreaded); in this case mm_(no)critical routines do not work properly
because they just set/unset global variable. This is OK for a single shared
memory space only.

If and when a server spawns different processes, whose memory spaces differ,
this lock must be replaced - by locking file etc.

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Thu, 4 Mar 1999 16:13:16 -0800 (PST)

> because they just set/unset global variable. This is OK for a single shared

Huh?  This statement makes no sense at all.

mm_critical() is your own routine, and it is called with the MAILSTREAM of the
stream which went critical.  That gives you everything that you need to do
what you want, including implementing a lock if that's what's necessary.

---

From: Calvin Lin <[email-masked]>
Date: Thu, 04 Mar 1999 17:56:59 -0800 (PST)

Multi-threading the c-client library is certainly possible,
if that's what Alex is asking...just make sure no globals are
used and if you have to use them, put them in a thread specific
data area.  File locking is a bit tricky cause fd's are shared
amount threads within one process...at least in Solaris.

	-cl

> mm_critical() is your own routine, and it is called with the MAILSTREAM of
> the stream which went critical.  That gives you everything that you need to
> do what you want, including implementing a lock if that's what's necessary.
>