[Python-checkins] CVS: python/dist/src/Python thread_pthread.h,2.30,2.30.6.1

Anthony Baxter anthonybaxter@users.sourceforge.net
2001年12月22日 20:07:27 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv16386/Python
Modified Files:
 Tag: release21-maint
	thread_pthread.h 
Log Message:
backport of solaris thread patch, adding PTHREAD_SCOPE_SYSTEM support:
 Improve threading on Solaris, according to SF patch #460269, submitted
 by bbrox@bbrox.org / lionel.ulmer@free.fr.
 
 This adds a configure check and if all goes well turns on the
 PTHREAD_SCOPE_SYSTEM thread attribute for new threads.
 
 This should remove the need to add tiny sleeps at the start of threads
 to allow other threads to be scheduled.
This is a semi-feature, but makes such a huge difference to the
performance of Zope on Solaris that it's worthwhile (well, imho).
Index: thread_pthread.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v
retrieving revision 2.30
retrieving revision 2.30.6.1
diff -C2 -d -r2.30 -r2.30.6.1
*** thread_pthread.h	2000年09月01日 23:29:28	2.30
--- thread_pthread.h	2001年12月23日 04:07:25	2.30.6.1
***************
*** 130,135 ****
--- 130,142 ----
 	int success;
 	dprintf(("PyThread_start_new_thread called\n"));
+ #ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+ 	pthread_attr_t attrs;
+ #endif
 	if (!initialized)
 		PyThread_init_thread();
+ #ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+ 	pthread_attr_init(&attrs);
+ 	pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
+ #endif
 
 	success = pthread_create(&th, 
***************
*** 147,151 ****
--- 154,162 ----
 				 arg
 #elif defined(PY_PTHREAD_STD)
+ #ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+ 				 &attrs,
+ #else
 				 (pthread_attr_t*)NULL,
+ #endif
 				 (void* (*)(void *))func,
 				 (void *)arg

AltStyle によって変換されたページ (->オリジナル) /