You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Marcello Marangio <m....@tno.it> on 2006/03/14 11:04:25 UTC

Home made concurrency with james

Hi all
I am dealing with the concurrency problem in james.
I read the code of jamesHA and it's not suitable for me,  because it uses
jdk1.5 and because it uses jcluster and jgroup to handle the clustering.

I would like to explain to you all an idea on a sort of "home made"
concurrency using james.

Here is the problem: 2 james instances (james1 and james2) running on the
same repository (db, file or whatever).

James1 is configured as the primary node, james2 is configured as secondary
node.

When it's started, James1 spawns a thread that updates every second (or
more, or less...) a record in a custom table on a db, writing a random
number.
James2 is configured to check a static variable in a custom init mailet
every mail to proces: if james1 is alive he will pass on every mail. When
it's started, James2 spawns a thread that reads the record every second (or
more): if the i-th value is equal to the (i-1)-th value this means that
james1 is dead, so james2 writes the static variable, waking him up. 

Can anyone think at any flaw in this algorithm?

I think it's fairly simple and solid to be a good standard concurrency
method.
I am going to develop the mechanism; if you guys think it's interesting to
pack it up for james, give me a shout.

Cheers
Marcello


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org