Message134031
The problem is that I don't know how to check in test_threadsignals which thread implementation is used in Python. It would be nice to have some functions providing such information in the sys or sysconfig module, maybe something like sys.float_info.
For example, sys._thread_info can be a dict like {'name': 'pthread', 'use_semaphore': True}.
Keys:
- name: cthread, lwp, nt, os2, pth, pthread, sgi, solaris or wince (sgi, lwp, pth, cthread may be removed from Python 3.3: #11876)
- maxproc: max # of threads that can be started (SGI only)
- stacksize: default stacksize for a thread (lwp, pthread and os2 only)
- min_stacksize: minimum stacksize for a thread (pthread, nt and os2 only)
- max_stacksize: maximum stacksize for a thread (nt and os2 only)
thread_pthread.h contains many #ifdef which may be interesting to have in thread_info:
- if _HAVE_BSDI is defined, don't use pthread_init()
- if THREAD_STACK_SIZE is defined, set the size of the thread stack
- if PTHREAD_SYSTEM_SCHED_SUPPORTED is defined: set scope to PTHREAD_SCOPE_SYSTEM
- if (defined(_POSIX_SEMAPHORES) && defined(HAVE_BROKEN_POSIX_SEMAPHORES) && defined(HAVE_SEM_TIMEDWAIT)): use semaphore
Well, the most important informations for this issue is the name of the thread implementation (pthread) and know if pthread semaphore are used or not. |
|
Date |
User |
Action |
Args |
2011-04-19 10:01:38 | vstinner | set | recipients:
+ vstinner, gregory.p.smith, db3l, pitrou, sable, rnk, neologix, python-dev |
2011-04-19 10:01:38 | vstinner | set | messageid: <1303207298.12.0.616377909935.issue11223@psf.upfronthosting.co.za> |
2011-04-19 10:01:37 | vstinner | link | issue11223 messages |
2011-04-19 10:01:37 | vstinner | create | |
|