Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 149

Show
Ignore:
Timestamp:
02/13/05 08:59:27
Author:
rdelon
Message:

Fixed Ticket #67: Got rid of old threading, forking and processPool config options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpconfig.py

    r108 r149  
    5353 
    5454    # Parameters used to tell what kind of server we want 
    55     # Note that numberOfProcesses, threading and forking conflict 
    56     # wich each other: if one has a non-null value, the other 
    57     # ones should be null (for numberOfProcesses, null means equal to one) 
    58     cpg.configOption.processPool = 0 # Used if we want to fork n processes 
    59                                  # at the beginning. In this case, all 
    60                                  # processes will listen on the same 
    61                                  # socket (this only works on unix) 
    62     cpg.configOption.threading = 0 # Used if we want to create a new 
    63                                # thread for each request 
    64     cpg.configOption.forking = 0 # Used if we want to create a new process 
    65                              # for each request 
    6655    cpg.configOption.threadPool = 0 # Used if we want to create a pool 
    6756                                # of threads at the beginning 
     
    115104            ('server', 'socketFile', 'str'), 
    116105            ('server', 'reverseDNS', 'int'), 
    117             ('server', 'processPool', 'int'), 
    118106            ('server', 'threadPool', 'int'), 
    119             ('server', 'threading', 'int'), 
    120             ('server', 'forking', 'int'), 
    121107            ('server', 'sslKeyFile', 'str'), 
    122108            ('server', 'sslCertificateFile', 'str'), 
     
    158144    _cpLogMessage("  reverseDNS: %s" % cpg.configOption.reverseDNS, 'CONFIG') 
    159145    _cpLogMessage("  socketQueueSize: %s" % cpg.configOption.socketQueueSize, 'CONFIG') 
    160     _cpLogMessage("  processPool: %s" % cpg.configOption.processPool, 'CONFIG') 
    161146    _cpLogMessage("  threadPool: %s" % cpg.configOption.threadPool, 'CONFIG') 
    162     _cpLogMessage("  threading: %s" % cpg.configOption.threading, 'CONFIG') 
    163     _cpLogMessage("  forking: %s" % cpg.configOption.forking, 'CONFIG') 
    164147    _cpLogMessage("  sslKeyFile: %s" % cpg.configOption.sslKeyFile, 'CONFIG') 
    165148    if cpg.configOption.sslKeyFile: 
     
    183166    if _reverseDNS not in (0,1): raise "CherryError: reverseDNS must be '0' or '1'" 
    184167    if _socketFile and not hasattr(socket, 'AF_UNIX'): raise "CherryError: Configuration file has socketFile, but this is only available on Unix machines" 
    185     if _processPool!=1 and not hasattr(os, 'fork'): raise "CherryError: Configuration file has processPool, but forking is not available on this operating system" 
    186     if _forking and not hasattr(os, 'fork'): raise "CherryError: Configuration file has forking, but forking is not available on this operating system" 
    187168    if _sslKeyFile: 
    188169        try: 
     
    192173    if _socketPort and _socketFile: raise "CherryError: In configuration file: socketPort and socketFile conflict with each other" 
    193174    if not _socketFile and not _socketPort: _socketPort=8000 # Default port 
    194     if _processPool==1: severalProcs=0 
    195     else: severalProcs=1 
    196     if _threadPool==1: severalThreads=0 
    197     else: severalThreads=1 
    198     if severalThreads+severalProcs+_threading+_forking>1: raise "CherryError: In configuration file: threadPool, processPool, threading and forking conflict with each other" 
    199175    if _sslKeyFile and not _sslCertificateFile: raise "CherryError: Configuration file has sslKeyFile but no sslCertificateFile" 
    200176    if _sslCertificateFile and not _sslKeyFile: raise "CherryError: Configuration file has sslCertificateFile but no sslKeyFile" 
     
    205181    if _sessionStorageType in ('custom', 'ram', 'cookie') and _sessionStorageFileDir!='': raise "CherryError: Configuration file has sessionStorageType set to 'custom, 'ram' or 'cookie' but a sessionStorageFileDir is specified" 
    206182    if _sessionStorageType=='file' and _sessionStorageFileDir=='': raise "CherryError: Configuration file has sessionStorageType set to 'file' but no sessionStorageFileDir" 
    207     if _sessionStorageType=='ram' and (_forking or severalProcs): 
    208         print "CherryWarning: 'ram' sessions might be buggy when using several processes" 
    209183 
  • trunk/cherrypy/_cpthreadinglocal.py

    r148 r149  
     1# This is a backport of Python-2.4's threading.local() implementation 
     2 
    13"""Thread-local objects 
    24 

Hosted by WebFaction

Log in as guest/cpguest to create tickets