On Thu, 26 Aug 2010 12:27:03 pm R. Alan Monroe wrote:
> > Any modern multi-tasking operating system will ensure than a while
> > loop doesn't kill your computer's responsiveness. A decent
> > operating system will still remain responsive even at 100% CPU
> > usage. Even Windows does that!
>
> Opini
> Any modern multi-tasking operating system will ensure than a while loop
> doesn't kill your computer's responsiveness. A decent operating system
> will still remain responsive even at 100% CPU usage. Even Windows does
> that!
Opinions vary. If you try this on a laptop, the end user will be qui
On Wed, 25 Aug 2010 03:25:12 pm Nitin Das wrote:
> The problem with this while loop is if your random value doesn't lie
> between the mentioned range then ur 100% cpu would be utilized. The
> one thing u can do is to sleep for some time lets say 0.5 sec after
> every while loop iteration , in this
On Wed, Aug 25, 2010 at 12:56 AM, Greg Bair wrote:
>
> It's not that the value doesn't lie between the mentioned range.
>
> What I'm doing is randomly fetching an item from a list of dicts
> (multi-dimensional ones from a JSON response) and accessing a value from it,
> but not every item has the k
On 08/25/2010 01:25 AM, Nitin Das wrote:
The problem with this while loop is if your random value doesn't lie
between the mentioned range then ur 100% cpu would be utilized. The
one thing u can do is to sleep for some time lets say 0.5 sec after
every while loop iteration , in this case ur cpu
The problem with this while loop is if your random value doesn't lie between
the mentioned range then ur 100% cpu would be utilized. The one thing u can
do is to sleep for some time lets say 0.5 sec after every while loop
iteration , in this case ur cpu utilization will go down.
--nitin
On Mon, A
On 8/23/2010 1:00 AM, Greg Bair wrote:
I have a method (I'll call it foo) that will either return None or an
object depending on a random value generated. What I want to happen
is that if I call foo(), i.e, f = foo() and it returns None, to
re-call it until it returns something else. I would
On 08/23/2010 01:10 AM, James Mills wrote:
On Mon, Aug 23, 2010 at 3:00 PM, Greg Bair wrote:
I have a method (I'll call it foo) that will either return None or an object
depending on a random value generated. What I want to happen is that if I
call foo(), i.e, f = foo() and it returns None
On Mon, Aug 23, 2010 at 3:00 PM, Greg Bair wrote:
> I have a method (I'll call it foo) that will either return None or an object
> depending on a random value generated. What I want to happen is that if I
> call foo(), i.e, f = foo() and it returns None, to re-call it until it
> returns something
I have a method (I'll call it foo) that will either return None or an
object depending on a random value generated. What I want to happen is
that if I call foo(), i.e, f = foo() and it returns None, to re-call it
until it returns something else. I would think this would be done with
a while l
10 matches
Mail list logo