CVS update: php31/main

From: Date: Fri, 28 Aug 1998 20:35:41 +0000
Subject: CVS update: php31/main
Groups: php.dev 
Request: Send a blank email to php-dev+get-644@lists.php.net to get a copy of this message
Date: Friday August 28, 1998 @ 16:35 Author: shane Update of /repository/php31/main In directory asf:/u2/tmp/cvs-serv14420/main Modified Files: language-scanner.l main.c php3_threads.h token_cache.c Log Message: fix some major threading issues in our dl functions. odbc was loading m$ odbc dlls which created new threads, and calling our dllmain which would then initialize php all over. A LOT of overhead is now gone. Still trying to figure out why certain odbc support dlls are getting loaded with each hit, even though were no longer calling dlopen on each thread. Also fixes to scanners for my flex fix Index: php31/main/language-scanner.l diff -c php31/main/language-scanner.l:2.7 php31/main/language-scanner.l:2.8 *** php31/main/language-scanner.l:2.7 Mon Aug 24 15:28:56 1998 --- php31/main/language-scanner.l Fri Aug 28 16:35:34 1998 *************** *** 81,89 **** #endif #ifndef YY_TLS_VARS ! /* NOTE, YY_TLS_VARS CANNOT have a semicolon after in in the code or it will break compilation in msvc5 */ ! #define YY_TLS_VARS #endif #ifndef TLS_VARS /* just to make sure ;) */ --- 81,89 ---- #endif #ifndef YY_TLS_VARS ! /* NOTE, YY_TLS_VARS; CANNOT have a semicolon after in in the code or it will break compilation in msvc5 */ ! #define YY_TLS_VARS; #endif #ifndef TLS_VARS /* just to make sure ;) */ *************** *** 122,128 **** void reset_scanner() { ! YY_TLS_VARS TLS_VARS; BEGIN(INITIAL); --- 122,128 ---- void reset_scanner() { ! YY_TLS_VARS; TLS_VARS; BEGIN(INITIAL); *************** *** 151,157 **** int include_file(pval *file, int display_source) { FILE *tmp; ! YY_TLS_VARS YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; PHPLexState lex_state; char *filename; --- 151,157 ---- int include_file(pval *file, int display_source) { FILE *tmp; ! YY_TLS_VARS; YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; PHPLexState lex_state; char *filename; *************** *** 198,204 **** void eval_string(pval *str,pval *return_offset, int display_source INLINE_TLS) { PHPLexState lex_state; ! YY_TLS_VARS YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; convert_to_string(str); --- 198,204 ---- void eval_string(pval *str,pval *return_offset, int display_source INLINE_TLS) { PHPLexState lex_state; ! YY_TLS_VARS; YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; convert_to_string(str); *************** *** 248,254 **** int conditional_include_file(pval *file,pval *return_offset INLINE_TLS) { PHPLexState lex_state; ! YY_TLS_VARS YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; FILE *tmp; char *filename; --- 248,254 ---- int conditional_include_file(pval *file,pval *return_offset INLINE_TLS) { PHPLexState lex_state; ! YY_TLS_VARS; YY_BUFFER_STATE buffer_state = YY_CURRENT_BUFFER; FILE *tmp; char *filename; *************** *** 292,298 **** /* returns 0 if scanning should be terminated */ int end_current_file_execution(INLINE_TLS_VOID) { ! YY_TLS_VARS if (stack_is_empty(&GLOBAL(input_source_stack))) { return 0; } else { --- 292,298 ---- /* returns 0 if scanning should be terminated */ int end_current_file_execution(INLINE_TLS_VOID) { ! YY_TLS_VARS; if (stack_is_empty(&GLOBAL(input_source_stack))) { return 0; } else { *************** *** 372,378 **** void clean_input_source_stack(void) { PHPLexState *lex_state; ! YY_TLS_VARS TLS_VARS; if (yyin) { --- 372,378 ---- void clean_input_source_stack(void) { PHPLexState *lex_state; ! YY_TLS_VARS; TLS_VARS; if (yyin) { Index: php31/main/main.c diff -c php31/main/main.c:2.27 php31/main/main.c:2.28 *** php31/main/main.c:2.27 Thu Aug 27 18:16:17 1998 --- php31/main/main.c Fri Aug 28 16:35:35 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 2.27 1998/08/27 22:16:17 shane Exp $ */ /* #define CRASH_DETECTION */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: main.c,v 2.28 1998/08/28 20:35:35 shane Exp $ */ /* #define CRASH_DETECTION */ *************** *** 1465,1470 **** --- 1465,1471 ---- #ifdef THREAD_SAFE php3_globals_struct *php3_globals; PHP3_TLS_GET(TlsIndex,php3_globals); + if(!php3_globals)return 1; #endif /* make a temporary php3_ini for startup */ GLOBAL(php3_ini)=_php3_copy_ini_master(); Index: php31/main/php3_threads.h diff -c php31/main/php3_threads.h:2.0 php31/main/php3_threads.h:2.1 *** php31/main/php3_threads.h:2.0 Fri Jul 3 09:17:29 1998 --- php31/main/php3_threads.h Fri Aug 28 16:35:36 1998 *************** *** 9,15 **** # define MUTEX_T void * # define MUTEX_INIT(a,b) (a=CreateMutex(b,FALSE,NULL)) # define MUTEX_DESTROY(a) CloseHandle(a) ! # define MUTEX_LOCK(a) WaitForSingleObject(a,INFINITE) # define MUTEX_UNLOCK(a) ReleaseMutex(a) # define CRITICAL_SECT_T CRITICAL_SECTION # define CRITICAL_INIT(a) InitializeCriticalSection(&a) --- 9,15 ---- # define MUTEX_T void * # define MUTEX_INIT(a,b) (a=CreateMutex(b,FALSE,NULL)) # define MUTEX_DESTROY(a) CloseHandle(a) ! # define MUTEX_LOCK(a) WaitForSingleObject(a,5) # define MUTEX_UNLOCK(a) ReleaseMutex(a) # define CRITICAL_SECT_T CRITICAL_SECTION # define CRITICAL_INIT(a) InitializeCriticalSection(&a) *************** *** 57,63 **** /* these are the THREAD API to be used with PHP and its modules*/ ! # define PHP3_MUTEX_ALLOC(a) a=php3_mutex_alloc() # define PHP3_MUTEX_FREE(a) php3_mutex_free(a) # define PHP3_CRITICAL_ALLOC(a) a=php3_critical_alloc() --- 57,63 ---- /* these are the THREAD API to be used with PHP and its modules*/ ! # define PHP3_MUTEX_ALLOC(a) if(!a)a=php3_mutex_alloc() # define PHP3_MUTEX_FREE(a) php3_mutex_free(a) # define PHP3_CRITICAL_ALLOC(a) a=php3_critical_alloc() Index: php31/main/token_cache.c diff -c php31/main/token_cache.c:2.3 php31/main/token_cache.c:2.4 *** php31/main/token_cache.c:2.3 Thu Aug 20 23:48:56 1998 --- php31/main/token_cache.c Fri Aug 28 16:35:37 1998 *************** *** 29,35 **** */ ! /* $Id: token_cache.c,v 2.3 1998/08/21 03:48:56 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 29,35 ---- */ ! /* $Id: token_cache.c,v 2.4 1998/08/28 20:35:37 shane Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 151,156 **** --- 151,157 ---- /* ugly hack to support $keyword */ if (last_token_suggests_variable_reference() && is_reserved_word(next_token.token_type)) { + /*FIXME YY_TLS_VARS*/ next_token.phplval.value.str.val = estrndup(phptext,phpleng); next_token.phplval.value.str.len = phpleng; next_token.phplval.type = IS_STRING; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#644) next »