Infinite loops and synchronization

Vincent Gulinao vincent.gulinao at
Mon Jul 13 01:06:11 EDT 2009

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 (synchronization)?

More information about the Python-list mailing list