Re: calling functions across threads

2004-12-29 Thread It's me
I haven't play with the thread stuff in Python (yet) but in general terms (from a C mind), one should not expect read/write actions to be sequential across threads. I would assume the Python threads eventually goes back to some system calls for thread handling. If that were the case, you should

Re: calling functions across threads

2004-12-29 Thread Steve Holden
Steven Bethard wrote: Fernando Perez wrote: Steven Bethard wrote: Fernando Perez wrote: Steven Bethard wrote: I get the correct output, but if you run this yourself, you'll see that the numbers 1 through 10 aren't printed in sync with the writes (i.e. every half second); they're all printed at t

Re: calling functions across threads

2004-12-29 Thread Steven Bethard
Fernando Perez wrote: Steven Bethard wrote: Fernando Perez wrote: Steven Bethard wrote: I get the correct output, but if you run this yourself, you'll see that the numbers 1 through 10 aren't printed in sync with the writes (i.e. every half second); they're all printed at the end. Could someone

Re: calling functions across threads

2004-12-29 Thread Fernando Perez
Steven Bethard wrote: > Fernando Perez wrote: >> Steven Bethard wrote: >> >> >>>I get the correct output, but if you run this yourself, you'll see that >>>the numbers 1 through 10 aren't printed in sync with the writes (i.e. >>>every half second); they're all printed at the end. Could someone >

Re: calling functions across threads

2004-12-29 Thread Steven Bethard
Fernando Perez wrote: Steven Bethard wrote: I get the correct output, but if you run this yourself, you'll see that the numbers 1 through 10 aren't printed in sync with the writes (i.e. every half second); they're all printed at the end. Could someone explain to me why this happens, and how (if p

Re: calling functions across threads

2004-12-29 Thread Fernando Perez
Steven Bethard wrote: > I get the correct output, but if you run this yourself, you'll see that > the numbers 1 through 10 aren't printed in sync with the writes (i.e. > every half second); they're all printed at the end. Could someone > explain to me why this happens, and how (if possible) I can

Re: calling functions across threads

2004-12-29 Thread Steven Bethard
Thomas Rast wrote: Steven Bethard <[EMAIL PROTECTED]> writes: I get the correct output, but if you run this yourself, you'll see that the numbers 1 through 10 aren't printed in sync with the writes (i.e. every half second); they're all printed at the end. Could someone explain to me why this happe

Re: calling functions across threads

2004-12-29 Thread Thomas Rast
Steven Bethard <[EMAIL PROTECTED]> writes: > I get the correct output, but if you run this yourself, you'll see > that the numbers 1 through 10 aren't printed in sync with the writes > (i.e. every half second); they're all printed at the end. Could > someone explain to me why this happens, and ho

calling functions across threads

2004-12-29 Thread Steven Bethard
I'm playing around with some threading stuff right now, and I'm having a little trouble calling a function from one thread that affects another. Here's my setup: py> import os, threading, time py> def write(file_in, input_lines): ... for line in input_lines: ... time.sleep(0.5) ...