In article ,
Vincent Gulinao wrote:
>
>lst = list()
>
>while True:
> if len(lst) == SOME_NUMBER:
> return lst
>
>Q2: operating on list from threads (mostly appends) must be safe,
>right (synchronization)?
What do you mean by "safe"? Python certainly won't crash, but there's
In message , Vincent
Gulinao wrote:
> Q1: is this a common OK practice? I'm worried infinite loops hogs memory.
The problem is not that the loop is infinite, but that it busy-waits,
hogging CPU.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 13, 6:06 am, Vincent Gulinao wrote:
> lst = list()
>
> (lst populated by async twisted deferred callbacks)
>
> while True:
> if len(lst) == SOME_NUMBER:
> return lst
>
> Q1: is this a common OK practice? I'm worried infinite loops hogs memory.
> Q2: operating on list
> Vincent Gulinao (VG) wrote:
>VG> lst = list()
>VG> (lst populated by async twisted deferred callbacks)
>VG> while True:
>VG>if len(lst) == SOME_NUMBER:
>VG>return lst
>VG> Q1: is this a common OK practice? I'm worried infinite loops hogs memory.
>VG> Q2: operating on list
lst = list()
(lst populated by async twisted deferred callbacks)
while True:
if len(lst) == SOME_NUMBER:
return lst
Q1: is this a common OK practice? I'm worried infinite loops hogs memory.
Q2: operating on list from threads (mostly appends) must be safe,
right (synchroni