[ROOT] Re: RE:MOD_CINT: problem with Win32 version of

From: Valery Fine (fine@bnl.gov)
Date: Sat Jul 22 2000 - 21:01:16 MEST


> ---------------------------------------------------------------------
> hi,
> 
> firstly , i would like to thank you to make CINT freely available,
> recently i encounter a problem , which is caused by 
> CINT is not thread-safe,
> here is the scenario:
> 
> i use a apache module to make cint act as a "server-side scripting language"
> in apache (like asp and jsp) : MOD_CINT, 
> http://linux.medyatext.com.tr/apache/cint.html
> under Linux , the module works fine,
> but under WinNT/98 , Apache use "multithreading" instead of "pre-forking"
> model , and this causes error when mod_cint is handling more than one request 
> at
> the same time,
> according to \cint\demo\mthread\readme.txt
> cint is not multi thread safe,  how could i solve the problem ?
> the child thread which will call CINT is created by Apache main worker,
> how could i make it thead-safe ?
> do i need to rewrite all my custom function ?
> please provide a way to go, thank you in advance.
> 
> 

  Hi, I think the way to go is to create the dedicated CINT thread with the event loop inside.
 This thread should be referred with some global pointer for example.
  The Apache main worker should create a simple thread. That  checks that CINT thread
  global pointer. If it is not present yet it starts that thread. Then it should pass the character
  string it gets to that thread via WIN32 SendMessage mechanize.

  This way the main worker creates as many "client" threads as it finds useful and the only 
 "server"  CINT. This way should be no "thread safe" problem but the CINT scope comes up.
  That your code should care about.

  Another way is NOT to create a dedicated CINT thread rather the separate Windows processes
  You can still communicate it via SendMessage. This way there is no CINT scope problem but
  the performance may show up.  My understanding it is very way the UNIX version of Apache 
  employs and they are happy with the performance it delivers.

  If the CINT scope is not issue I would advice the dedicated thread.

                         Valery



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:30 MET