Re: Re[4]: Re: New stackless proposal
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <004001c46851$d57dfd20$0d01a8c0@MarkVaio> |
Lenard Lindstrom wrote: > So a terminating thread will raise an exception on all threads > waiting on it? Yes. I can't think of any alternative. Otherwise they would sit there forever. > def genfun(): > sleep(1.0) # A very intensive computation > # Return without calling yield > generator = Thread(genfun) > > iter = generator().iter_() # Generator goes to sleep > iter.next() # Now yielding to sleeping generator > thread. Will I hang? You will hang for 1.0 seconds and then throw a stop exception.