>  Now.. onto other matter of threading. How does citadel's theading   
 >work.  I've noticed that (predictably), if I start a long running   
 >script from  one connection, then try and start python from another   
 >connection, the  server barfs on a threading gotchya. Aparently   
   
 Sorry I missed this question earlier.  
   
 citserver uses a "worker thread" model.  We have a pool of threads that 
sit around waiting for something to do.  A mutex is used to make sure only 
one thread wakes up at a time; it blocks on select() and waits for 
something to happen on the network.  The thread is then bound to a Citadel 
session (a record of type "struct CitContext") and it goes off and does 
its thing.  Usually this binding lasts for the duration of a single server 
command.  This could be a very quick command (such as NOOP) or a 
long-running command (such as CHAT).  When the command completes, the 
thread is unbound from the session and goes back into the pool.  
   
 As you've probably discovered, the macro "CC" is used to point to "the 
session which this thread is bound to right now."  

Reply via email to