Re: threads and sleep?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: threads and sleep?

From: Mike Meyer <mwm@mired.org>
Date: Tue Jul 05 2005 - 18:00:04 CEST

Jeffrey Maitland <jeff.maitland@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@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Received on Thu Sep 29 16:46:08 2005