Problem with threading on Solaris

Lionel Ulmer bbrox at bbrox.org
Fri Sep 7 11:45:23 EDT 2001


On Fri, 7 Sep 2001 15:08:46 +0000 (UTC), Lionel Ulmer <bbrox at bbrox.org> wrote:
>So I wonder if :
> = it's a bug in Solaris' pthread library
> = it's Python that is not using PThread properly on the Solaris platform

Just to follow-up on myself, I just did some tests with pthread on my
Solaris box. And to have what I feel to be the 'correct' behaviour on
pthread, you need to do that :

  pthread_attr_init(&attr)
  pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)

And use these attributes at thread creation.

With these options, the thread are running 'concurrently'. Now, I did not
see anywhere on Python documentations what the scheduling model is for
threads... But as I did NOT see any way to :
 1) set the thread priority
 2) do a 'yield'
I thought that the way it was planned to work was to 'round-robin' through
the different threads (ie shcedule them as Unix processes are scheduled).

For information, my Solaris version :

    SunOS herzum 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-5_10

-- 
		 Lionel Ulmer - http://www.bbrox.org/



More information about the Python-list mailing list