S
Steven D'Aprano
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
two it with threads!" problems.
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
A programmer had a problem, and thought Now he has "I know, I'll
solve two it with threads!" problems.
A newbie programmer had a problem and thought
"I'll solve it by posting on
(e-mail address removed) and on Google Groups".
And now we have the problem of two threads...
And, when faced with problems of having two threads, the most obvious
solution is to add sleep() calls, so it looks like the above... Am I
dragging the analogy out too far?
ChrisA
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
It took me a moment to figure it out, but in the end I smiled and I
agree: +1.
With this, however, I don't agree. If Python's GIL didn't interfere with
the concurrency of threads,
I can't think of a good reason to use
multiple processes instead, except to use a tool that runs outside the
Python virtual machine, or to provide more fault tolerance for long-
running server-like applications. We're all adults here, and if the
policy is to invoke the methods of objects as documented, then that
policy extends to stepping on (or not stepping on) the memory of other
threads, too.
The APIs for threads and processes is pretty much the same, so I suppose
it doesn't matter much, either. Use the right tool for the job.
Dan
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
The same applies to regular expressions, which is actually what the
expression was first used with years ago. Probably applies to just
about any technology. Including Java.
Steven cleverly worded it in such a way as to apply directly to threads.
The sentences are jumbled and interleaved, as if they were the output of
two threads that are not synchronized.
Steven D'Aprano said:A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
Host: Last week the Royal Festival Hall saw the first performance of a new
logfile by one of the world's leading modern programmers, Steven
"Two threads" D'Aprano. Mr D'Aprano.
D'Aprano: No, no. Look. This thread business -- it doesn't really matter.
The threads aren't important. A few friends call me Two Threads and that's
all there is to it. I wish you'd ask me about the logfile. Everybody talks
about the threads. They've got it out of proportion -- I'm a programmer.
I'm going to get rid of the thread. I'm fed up with it!
Host: Then you'll be Steven "No Threads" D'Aprano, eh?
Steven D'Aprano said:A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
Host: Last week the Royal Festival Hall saw the first performance of a new
logfile by one of the world's leading modern programmers, Steven
"Two threads" D'Aprano. Mr D'Aprano.
D'Aprano: Hello.
Host: May I just sidetrack for one moment. This -- what shall I call it --
nickname of yours...
D'Aprano: Ah yes.
Host: "Two threads". How did you come by it? [...]
Host: I see, I see. And you're thinking of spawning this second thread to
write in!
D'Aprano: No, no. Look. This thread business -- it doesn't really matter.
The threads aren't important. A few friends call me Two Threads and that's
all there is to it. I wish you'd ask me about the logfile. Everybody talks
about the threads. They've got it out of proportion -- I'm a programmer.
I'm going to get rid of the thread. I'm fed up with it!
Host: Then you'll be Steven "No Threads" D'Aprano, eh?
A programmer had a problem, and thought Now he has "I know, I'll solve
two it with threads!" problems.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.