threads and sleep?

Mike Meyer mwm at mired.org
Tue Jul 5 12:00:04 EDT 2005


Jeffrey Maitland <jeff.maitland at gmail.com> writes:
> What I would like to do is have say 1 thread use as much of a given
> CPU as possible and if a new thread is started (added) that if a CPU
> is available use it instead of using the same cpu. That way it should
> speed the application up.  The standalone (non-threaded) app uses 90+
> % of a single cpu when in this part of the algorithm, that is why I
> split and threaded that part of the algorithm there to try and speed
> it up because this part is repeated several times.   I can post
> generic code of what I am doing but can't post the actuall code
> because of the confidentially of it.  Thanks again in advance for any
> and all comments (even any spitefull ones)

This kind of fine control over CPU allocation is very
plaform-specific. Some don't allow it at all. If your platform does,
the details on how you go about doing it will vary depending on the
platform.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list