Re: Threaded Design Question

2007-08-10 Thread greg
[EMAIL PROTECTED] wrote: > I ended up taking this route for the most part. The worker thread > first moves the file to be processed into a temp directory, No, the watcher thread should do this itself *before* putting it into the work queue. Then there's no chance of it picking up the same file tw

Re: Threaded Design Question

2007-08-10 Thread half . italian
On Aug 9, 9:45 pm, "Mark T" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if

Re: Threaded Design Question

2007-08-10 Thread Graeme Glass
Using IPC is just adding needles complexity to your program. Instead of constantly scanning the directory for files and then adding them to a Queue, and then having to worry if that specific file may have already been popped off the queue and is currently running by one of the workers, just poll th

Re: Threaded Design Question

2007-08-09 Thread Mark T
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 5:39 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > > > Hi all! I'm implementing one of my first multithreaded apps, and have > > gotten to a point where I think I'm going off track from a standard > > idiom. Wondering if anyone can point me in the r

Re: Threaded Design Question

2007-08-09 Thread Justin T.
> approach. That sounds the easiest, although I'm still interested in > any idioms or other proven approaches for this sort of thing. > > ~Sean Idioms certainly have their place, but in the end you want clear, correct code. In the case of multi-threaded programming, synchronization adds complexi

Re: Threaded Design Question

2007-08-09 Thread half . italian
On Aug 9, 12:09 pm, "Justin T." <[EMAIL PROTECTED]> wrote: > On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > > Here's how I have it designed so far. The main thread starts a > > Watch(threading.Thread) class that loops and searches a directory for > > files. It has been passed a Queue.Queue() ob

Re: Threaded Design Question

2007-08-09 Thread MRAB
On Aug 9, 7:25 pm, [EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch

Re: Threaded Design Question

2007-08-09 Thread Jun-geun Park
[EMAIL PROTECTED] wrote: > Hi all! I'm implementing one of my first multithreaded apps, and have > gotten to a point where I think I'm going off track from a standard > idiom. Wondering if anyone can point me in the right direction. > > The script will run as a daemon and watch a given directory

Re: Threaded Design Question

2007-08-09 Thread Justin T.
On Aug 9, 11:25 am, [EMAIL PROTECTED] wrote: > > Here's how I have it designed so far. The main thread starts a > Watch(threading.Thread) class that loops and searches a directory for > files. It has been passed a Queue.Queue() object (watch_queue), and > as it finds new files in the watch folder

Threaded Design Question

2007-08-09 Thread half . italian
Hi all! I'm implementing one of my first multithreaded apps, and have gotten to a point where I think I'm going off track from a standard idiom. Wondering if anyone can point me in the right direction. The script will run as a daemon and watch a given directory for new files. Once it determines