Re: Too Much Context Switching?



Kris Kennaway wrote:

In 6.x. the default thread library is quite inefficient although it can
make use of multiple CPUs (again, providing the application is giving
them work to do). For multi-threaded performance you will be better off
switching to the libthr library (see libmap.conf(5)) or updating to 7.0
(where it is the default). This isn't likely to be the underlying issue
if you are trying to debug a loss of performance relative to the same
configuration in the past though.

Indeed Plone is written in python, and python has a "Big Giant Lock"
inside which insures that only one thread can execute, in order to
protect the python structures. This lock is only released under special
circumstances, such as doing IO. Hence it is necessary to run several
instances of python programs and do synchronization work, if one wants
to make use of several CPUs, or use python threads, and immediately make
some IOs, or similar techniques. It may be that using Jython, if
possible, yields better threading behavior. When doing some work
according to these ideas, i had found quite severe contention, and this
was not cured when switching native threading libraries (libksd, libthr,
etc.). The problem is really inside python.


--

Michel TALON

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Jython, GILs and object locking.
    ... and I'm willing to bet 5$ that the Zope developers would ... big hardware by the GIL-ized interpreter preventing multiple CPUs ... anyplace that mentions threading) mention that python, ...
    (comp.lang.python)
  • Re: Too Much Context Switching?
    ... make use of multiple CPUs. ... For multi-threaded performance you will be better off switching to the libthr library ) or updating to 7.0. ... protect the python structures. ... possible, yields better threading behavior. ...
    (freebsd-questions)
  • Re: Too Much Context Switching?
    ... can make use of multiple CPUs. ... For multi-threaded performance you will be better off switching to the libthr library ) or updating to 7.0. ... protect the python structures. ... possible, yields better threading behavior. ...
    (freebsd-questions)
  • Re: Too Much Context Switching?
    ... can make use of multiple CPUs (again, ... Indeed Plone is written in python, and python has a "Big Giant Lock" ... possible, yields better threading behavior. ... was not cured when switching native threading libraries (libksd, libthr, ...
    (freebsd-questions)
  • RE: Tracing down segfault
    ... >> consistently segfault. ... > It's especially useful to rebuild Python that way. ... all of the threading module is written ... That exit function called "Destroy" ...
    (comp.lang.python)