gt; what part of threading in python am I not properly understanding?
Unless I'm missing something, your description doesn't make this sound
like either a python-specific problem, or a threading problem. Threads
run when it's their turn and they aren't blocked, and you haven't
I have the following issue:
My program runs a thread called the MainThread, that loops trough a
number of URLs and decides when it's the right time for one to be
fetched. Once a URL has to be fetched, it's added to a Queue object,
where the FetchingThread picks up and does the actual work. Often,
mk wrote:
Hello everyone,
I wrote "concurrent ssh" client using Paramiko, available here:
http://python.domeny.com/cssh.py
This program has a function for concurrent remote file/dir copying
(class SSHThread, method 'sendfile'). One thread per host specified is
started for copying (with a wo
Hello everyone,
I wrote "concurrent ssh" client using Paramiko, available here:
http://python.domeny.com/cssh.py
This program has a function for concurrent remote file/dir copying
(class SSHThread, method 'sendfile'). One thread per host specified is
started for copying (with a working queue
On Jun 11, 3:07 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > I pasted my current solution athttp://codepad.org/FXF2SWmg. Any
> > feedback, especially if it has to do with proving or disproving its
> > correctness, will be appreciat
On Jun 11, 10:13 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Tue, 10 Jun 2008 22:46:37 -0700 (PDT), George Sakkis <[EMAIL PROTECTED]>
> wrote:
> >On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
>
> >> I had a little trouble understanding what exact problem it is that you ar
In article <[EMAIL PROTECTED]>,
George Sakkis <[EMAIL PROTECTED]> wrote:
>
>I'd like some feedback on a solution to a variant of the producer-
>consumer problem. My first few attempts turned out to deadlock
>occasionally; this one seems to be deadlock-free so far but I can't
>tell if it's provably
On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> I pasted my current solution athttp://codepad.org/FXF2SWmg. Any
> feedback, especially if it has to do with proving or disproving its
> correctness, will be appreciated.
It seems like you're reinventing the wheel. The Queue class do
On Jun 11, 6:00 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 11, 1:59 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote:
>
> > Why not use a normal Queue, put a dummy value (such as None) in when
> > you're producer has finished, and have the main thread use the normal
> > Thread.join() method o
On Tue, 10 Jun 2008 22:46:37 -0700 (PDT), George Sakkis <[EMAIL PROTECTED]>
wrote:
On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
I had a little trouble understanding what exact problem it is that you are
trying to solve but I'm pretty sure that you can do it with one of two metho
George Sakkis wrote:
On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
I had a little trouble understanding what exact problem it is that you are
trying to solve but I'm pretty sure that you can do it with one of two methods:
Ok, let me try again with a different example: I want to d
> Sounds like a sentinel would work for this. The producer puts a
> specific object (say, None) in the queue and the consumer checks for
> this object and stops consuming when it sees it. But that seems so
> obvious I suspect there's something else up.
There's a decent implementation of thi
On Jun 11, 1:59 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote:
> Why not use a normal Queue, put a dummy value (such as None) in when
> you're producer has finished, and have the main thread use the normal
> Thread.join() method on all your child threads?
I just gave two reasons:
- Concurrency / in
On Jun 10, 11:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> I'd like some feedback on a solution to a variant of the producer-
> consumer problem. My first few attempts turned out to deadlock
> occasionally; this one seems to be deadlock-free so far but I can't
> tell if it's provably correct,
Why not use a normal Queue, put a dummy value (such as None) in when
you're producer has finished, and have the main thread use the normal
Thread.join() method on all your child threads?
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 10, 11:47 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
>
> I had a little trouble understanding what exact problem it is that you are
> trying to solve but I'm pretty sure that you can do it with one of two
> methods:
Ok, let me try again with a different example: I want to do what can
be ea
George Sakkis wrote:
I'd like some feedback on a solution to a variant of the producer-
consumer problem. My first few attempts turned out to deadlock
occasionally; this one seems to be deadlock-free so far but I can't
tell if it's provably correct, and if so, whether it can be
simplified.
The g
I'd like some feedback on a solution to a variant of the producer-
consumer problem. My first few attempts turned out to deadlock
occasionally; this one seems to be deadlock-free so far but I can't
tell if it's provably correct, and if so, whether it can be
simplified.
The generic producer-consume
In article
<[EMAIL PROTECTED]>,
Pradip <[EMAIL PROTECTED]> wrote:
> Hello every body. I am new to this forum and also in Python.
> Read many things about multi threading in python. But still having
> problem.
>
> I am using Django Framework with Python having PostgreSQL as backend
> database wi
Hello every body. I am new to this forum and also in Python.
Read many things about multi threading in python. But still having
problem.
I am using Django Framework with Python having PostgreSQL as backend
database with Linux OS. My applications are long running. I am using
threading.
The problem
Tried that on Python 2.5 on Windows and it worked.
John Nagle
Abandoned wrote:
> Hi..
> I want to threading but i have a interesting error..
> ==
> class SelectAll(threading.Thread):
>def __init__(self, name):
> threading.Thread.__init
Abandoned schrieb:
> Hi..
> I want to threading but i have a interesting error..
> ==
> class SelectAll(threading.Thread):
>def __init__(self, name):
> threading.Thread.__init__(self)
> self.name = name #kelime
>
>def run(self):
>
>
> self.result=.
Hi..
I want to threading but i have a interesting error..
==
class SelectAll(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name #kelime
def run(self):
self.result=...
nglist=[]
current = SelectAll(name)
ngli
In message <[EMAIL PROTECTED]>, Philip
Zigoris wrote:
> ... and the server
> would go into a state where the master thread repeatedly polled the
> socket and printed an error.
Is that because it cannot create a new socket to accept the connection on?
--
http://mail.python.org/mailman/listinfo/py
Hi all,
I have written a socket based service in python and under fairly heavy
traffic it performs really well. But i have encountered the following
problem: when the system runs out of file descriptors, it seems to
stop switching control between threads.
Here is some more detail:
The system ha
> Here the error message:
Exception in thread Thread-1:
> Traceback (most recent call last):
> File "C:\Program Files\Python\lib\threading.py", line 442, in
> __bootstrap
> self.run()
> File "G:\Robot teleskop\VRT\test\test2.py", line 25, in run
> Document.OpenFile('F:/Images/VRT
Thank You, but now it cannot open a file, but it should work...
Here the error message:
>>> Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Python\lib\threading.py", line 442, in __bootstrap
self.run()
File "G:\Robot teleskop\VRT\test\test2.py", line
Aleksandar Cikota wrote:
> How to integrate the Code-part in the main programm, so that the
> mainprogramm works?
>
> Code:
>
> import win32com.client
> import time
> import os
> import threading
>
> Document = win32com.client.Dispatch('MaxIm.Document')
> Application = win32com.client.Dispatch(
Hi all,
I have a problem with threading. The following part should be running in a main programm all the time, but so that the main programm also works (like 2 seperate programms, but in one)
How to integrate the Code-part in the main programm, so that the mainprogramm works?
Code:
impo
On Wed, 22 Dec 2004 12:55:46 +, Alan Kennedy <[EMAIL PROTECTED]> wrote:
> [Norbert]
> > i am experimenting with threads and get puzzling results.
> > Consider the following example:
> > #
> > import threading, time
> >
> > def threadfunction():
> > print "threadfunction:
Steve Holden wrote:
> Well, I don't believe there's any guarantee that a thread will get run
> preference over its
> starter - they're both threads, after all. Try putting a sleep after
> th.start() and before the
> print statement and you should see that the "worker" thread runs while the
>
Thanks Alan,
i hoped it would be something trivial :)
Norbert
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a lot, Steve, for your fast reply.
But the behaviour is the same if 'threadfunction' sleeps longer than
just 1 second. 'threadfunction' is of course a dummy to show the
problem, imagine a longrunning background-task.
If you are right, the question remains 'How can I assure that the
starting
[Norbert]
> i am experimenting with threads and get puzzling results.
> Consider the following example:
> #
> import threading, time
>
> def threadfunction():
> print "threadfunction: entered"
> x = 10
> while x < 40:
> time.sleep(1) # time unit is seconds
>
Norbert wrote:
Hello *,
i am experimenting with threads and get puzzling results.
Consider the following example:
#
import threading, time
def threadfunction():
.print "threadfunction: entered"
.x = 10
.while x < 40:
.time.sleep(1) # time unit is seconds
Hello *,
i am experimenting with threads and get puzzling results.
Consider the following example:
#
import threading, time
def threadfunction():
print "threadfunction: entered"
x = 10
while x < 40:
time.sleep(1) # time unit is seconds
print "threadf
On Fri, 10 Dec 2004 00:12:16 GMT, Steven Bethard
<[EMAIL PROTECTED]> wrote:
I think if you change the call to look like:
threading.Thread(target=run, args=(os.path.join('c:\\', path),)).start()
oh i see now. thanks
s='sdgdfgdfg'
s == (s)
True
s == (s,)
False
--
http://mail.python.org/mailman/li
Egor Bolonev wrote:
hi all
my program terminates with error i dont know why it tells 'TypeError:
run() takes exactly 1 argument (10 given)'
[snip]
threading.Thread(target = run, args = (os.path.join('c:\\',
path))).start()
I believe the args argument to threading.Thread is supposed to b
hi all
my program terminates with error i dont know why it tells 'TypeError:
run() takes exactly 1 argument (10 given)'
=program
import os, os.path, threading, sys
def get_all_files(path):
"""return all files of folder path, scan with subfolders
"""
if len(path) >
Jeremy Jones wrote:
* the get method on a queue object has a "block" flag. You can
effectively poll your queues something like this:
#untested code
#a_done, b_done and c_done are just checks to see if that particular
document is done
while not (a_done and b_done and c_done):
got_a, got_b, go
Alban Hertroys wrote:
Jeremy Jones wrote:
(not waiting, because it already did happen). What is it exactly
that you are trying to accomplish? I'm sure there is a better approach.
I think I saw at least a bit of the light, reading up on readers and
writers (A colleague showed up with a book cal
Jeremy Jones wrote:
(not waiting, because it already did happen). What is it exactly that
you are trying to accomplish? I'm sure there is a better approach.
I think I saw at least a bit of the light, reading up on readers and
writers (A colleague showed up with a book called "Operating system
Jeremy Jones wrote:
Alban Hertroys wrote:
Notify is called before thread B (in this case) hits the
condAllowed.wait() piece of code. So, it sits at that wait() for
forever (because it doesn't get notified, because the notification
already happened), waiting to be notified from the main thread,
Alban Hertroys wrote:
Hello
all,
I need your wisdom again. I'm working on a multi-threaded application
that handles multiple data sources in small batches each time. The idea
is that there are 3 threads that run simultaneously, each read a fixed
number of records, and then they wait for e
Hello all,
I need your wisdom again. I'm working on a multi-threaded application
that handles multiple data sources in small batches each time. The idea
is that there are 3 threads that run simultaneously, each read a fixed
number of records, and then they wait for eachother. After that the main
45 matches
Mail list logo