[Twisted-Python] Re: [Twisted-commits] blocking is the mindkiller

On Fri, 13 Dec 2002 16:33:37 -0600, exarkun CVS <exarkun@twistedmatrix.com> wrote:
No... *threading* is the mindkiller. What is the point of the addition of this function? I note that it's not yet used anywhere (thank goodness). The use of a thread for loading plugins like this is going to run non-thread-safe code in a thread for sure. (Heck, is __import__ even threadsafe?) If you want a deferred version of this, maybe it would be more appropriate to chunk the work from getPluginFileList so that it can be run with callLater with some short timeout? -- | <`'> | Glyph Lefkowitz: Traveling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |

Hi, Glyph Lefkowitz:
No... *threading* is the mindkiller.
Sometimes you can't work well without it. Database accesses are one common example; so are file accesses across a network. That being said, anything you only do _once_ shouldn't require threading -- and importing stuff certainly qualifies. An additional half-second slowdown sometime after startup doesn't hurt anybody. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ -- To think is to differ. -- Clarence Darrow, Scopes trial, July 1925

On Sun, Dec 15, 2002 at 03:22:26AM +0100, Matthias Urlichs wrote:
*cough*tenseconds*cough*
slowdown sometime after startup doesn't hurt anybody.
twisted.python.plugin.getPlugIns *should* do caching, but I'm not up to working out just how that should work; the threaded hack was committed in a moment of laziness (and it is now in my code instead of twisted, even though it is probably "correct" ;) I could also see some neat ways to break it up w/ a generator and have it called piecewise... mmh, but threading works for me for the moment; maybe some other time.
-- "If you find a neighbor in need, you're responsible for serving that neighbor in need, you're responsible for loving a neighbor just like you'd like to love yourself." -- George W. Bush, Sept. 16, 2002 -- 12:00am up 4 days, 22:17, 4 users, load average: 0.08, 0.09, 0.04

Hi, Bruce Mitchener:
I know -- it's just a network connection, after all. Unfortunately, many interfaces (as well es Python's DBI) just Don't Do That. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ -- Sell a country! Why not sell the air, the great sea, as well as the earth? Did not the Great Spirit make them all for the use of his children? -- Tecumseh, (Shawnee)

Hi, Glyph Lefkowitz:
No... *threading* is the mindkiller.
Sometimes you can't work well without it. Database accesses are one common example; so are file accesses across a network. That being said, anything you only do _once_ shouldn't require threading -- and importing stuff certainly qualifies. An additional half-second slowdown sometime after startup doesn't hurt anybody. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ -- To think is to differ. -- Clarence Darrow, Scopes trial, July 1925

On Sun, Dec 15, 2002 at 03:22:26AM +0100, Matthias Urlichs wrote:
*cough*tenseconds*cough*
slowdown sometime after startup doesn't hurt anybody.
twisted.python.plugin.getPlugIns *should* do caching, but I'm not up to working out just how that should work; the threaded hack was committed in a moment of laziness (and it is now in my code instead of twisted, even though it is probably "correct" ;) I could also see some neat ways to break it up w/ a generator and have it called piecewise... mmh, but threading works for me for the moment; maybe some other time.
-- "If you find a neighbor in need, you're responsible for serving that neighbor in need, you're responsible for loving a neighbor just like you'd like to love yourself." -- George W. Bush, Sept. 16, 2002 -- 12:00am up 4 days, 22:17, 4 users, load average: 0.08, 0.09, 0.04

Hi, Bruce Mitchener:
I know -- it's just a network connection, after all. Unfortunately, many interfaces (as well es Python's DBI) just Don't Do That. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/ -- Sell a country! Why not sell the air, the great sea, as well as the earth? Did not the Great Spirit make them all for the use of his children? -- Tecumseh, (Shawnee)
participants (4)
-
Bruce Mitchener
-
Glyph Lefkowitz
-
Jp Calderone
-
Matthias Urlichs