Re: mutual exclusion

2007-08-17 Thread Jacob Kaplan-Moss
On 8/17/07, Derek Anderson <[EMAIL PROTECTED]> wrote: > this means 16 mailer threads (or 32, if two machines). but i only want > one mailer thread running at a time. (to avoid sending duplicate emails > during a race condition) but apache kills and restarts processes, so i > can't just randoml

Re: mutual exclusion

2007-08-17 Thread Derek Anderson
i guess i should have done a better job of explaining myself. :) am using a very typical apache setup - yes w/ multiple processes. picture this: 1 (or more) apache server, one (or more) physical machine. - each spawns say 16 server processes - each process contains one thread, named "mail

Re: mutual exclusion

2007-08-17 Thread Jeremy Dunck
I'm not sure how you're deploying, but most people use multiple processes rather than a single process. Given that, an in-process mutex will do you no good. If you really are single-process, Django does not have a built-in mutex, but maybe you want: http://docs.python.org/lib/module-mutex.html

Re: mutual exclusion

2007-08-17 Thread Derek Anderson
no, not trying to farm out many threads. already have many threads running. (from apache) and (obviously) there is no master thread to do the coordination. see: http://en.wikipedia.org/wiki/Mutual_exclusion just want to make sure no two threads are entering the same critical section at the

Re: mutual exclusion

2007-08-17 Thread Jeremy Dunck
I think you want gearmand: http://www.danga.com/gearman/ It has a 'uniq' property that ensures only one job with a given name is running. On 8/17/07, Derek Anderson <[EMAIL PROTECTED]> wrote: > > i have a number of background threads in my app, and for a few of them i > want to make sure only on

Re: mutual exclusion

2007-08-17 Thread Derek Anderson
e: >> hey, >> >> how is everyone handling mutual exclusion between server threads in >> django? is there a built-in method i'm missing? > > What are you trying to accomplish? > > > > --~--~-~--~~~---~--~~ You receiv

Re: mutual exclusion

2007-08-16 Thread Jeremy Dunck
On 8/16/07, Derek Anderson <[EMAIL PROTECTED]> wrote: > > hey, > > how is everyone handling mutual exclusion between server threads in > django? is there a built-in method i'm missing? What are you trying to accomplish? --~--~-~--~~~---~

mutual exclusion

2007-08-16 Thread Derek Anderson
hey, how is everyone handling mutual exclusion between server threads in django? is there a built-in method i'm missing? derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr