Re: Multiple Threads - I/O in Same File

2011-11-21 Thread James Matthews
You may have some issues with disk reading as the drive heads move in different ways On Mon, Nov 21, 2011 at 8:15 AM, wrote: > Hi All, > > ** ** > > Just a question in general. Is it possible that we have opened one file > in r+ mode ( file1.txt ). > > We have 2 threads, > > **·

Re: Multiple threads

2011-11-16 Thread Jack Keegan
On Wed, Nov 16, 2011 at 6:30 PM, Dave Angel wrote: > On 11/16/2011 01:22 PM, Dave Angel wrote: > >> (You're top-posting. Put your remarks AFTER what you're quoting) >> >> On 11/16/2011 12:52 PM, Jack Keegan wrote: >> >>> Ok, I thought that processes would do the same job as threads. So would >>>

Re: Multiple threads

2011-11-16 Thread Miki Tebeka
You can see an example on how to use multiprocessing.Pool at http://pythonwise.blogspot.com/2011/03/convert-oggs-to-mp3-fast-way.html This is ogg -> mp3 but the same idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple threads

2011-11-16 Thread Dave Angel
On 11/16/2011 01:22 PM, Dave Angel wrote: (You're top-posting. Put your remarks AFTER what you're quoting) On 11/16/2011 12:52 PM, Jack Keegan wrote: Ok, I thought that processes would do the same job as threads. So would the general rule be some thing like so: If I want another piece of wor

Re: Multiple threads

2011-11-16 Thread Dave Angel
On 11/16/2011 12:55 PM, Michael Hunter wrote: On Wed, Nov 16, 2011 at 9:27 AM, Dave Angel wrote: On 11/16/2011 12:00 PM, Jack Keegan wrote: [...] Processes [...] and the OS is generally better at scheduling them than it is at scheduling threads within a single process. If you have multiple co

Re: Multiple threads

2011-11-16 Thread Michael Hunter
On Wed, Nov 16, 2011 at 9:27 AM, Dave Angel wrote: > On 11/16/2011 12:00 PM, Jack Keegan wrote: >[...] Processes [...] and the OS is generally better at scheduling them than >it is at > scheduling threads within a single process.  If you have multiple cores, the > processes can really run simulta

Re: Multiple threads

2011-11-16 Thread Dave Angel
On 11/16/2011 12:00 PM, Jack Keegan wrote: Hi Chris, On Wed, Nov 16, 2011 at 1:55 PM, Chris Angelico wrote: First off, it's better in CPython (the most popular Python) to use multiple processes than multiple threads. I had been looking into treads and process/subprocess myself a while ago a

Re: Multiple threads

2011-11-16 Thread Jack Keegan
Hi Chris, On Wed, Nov 16, 2011 at 1:55 PM, Chris Angelico wrote: > First off, it's better in CPython (the most popular Python) to use > multiple processes than multiple threads. I had been looking into treads and process/subprocess myself a while ago and couldn't decide which would suit what I

Re: Multiple threads

2011-11-16 Thread Thomas Rachel
Am 16.11.2011 14:48 schrieb Eduardo Oliva: Hello, I have a py script that reads for all "m2ts" video files and convert them to "mpeg" using ffmpeg with command line. What I want to do is: I need my script to run 2 separated threads, and then when the first has finished, starts the next one

Re: Multiple threads

2011-11-16 Thread Christian Heimes
Am 16.11.2011 14:48, schrieb Eduardo Oliva: > Hello, I have a py script that reads for all "m2ts" video files and convert > them to "mpeg" using ffmpeg with command line. > > What I want to do is: > > I need my script to run 2 separated threads, and then when the first has > finished, starts

Re: Multiple threads

2011-11-16 Thread Henrik Faber
On 16.11.2011 14:48, Eduardo Oliva wrote: > I need my script to run 2 separated threads, and then when the first has > finished, starts the next onebut no more than 2 threads. > I know that Semaphores would help with that. > But the problem here is to know when the thread has finished i

Re: Multiple threads

2011-11-16 Thread Chris Angelico
On Thu, Nov 17, 2011 at 12:48 AM, Eduardo Oliva wrote: > Hello, I have a py script that reads for all "m2ts" video files and convert > them to "mpeg" using ffmpeg with command line. > > What I want to do is: > >  I need my script to run 2 separated threads, and then when the first has > finished

Re: multiple threads with Logging: ValueError: I/O operation on closed file

2008-11-10 Thread Vinay Sajip
On Nov 8, 10:52 pm, [EMAIL PROTECTED] wrote: > OS: Solaris 9 > Python Version: 2.4.4 > > I need to log certain data in a worker thread; however, I am getting > an error now when I use two worker threads. > I think the problem comes from the linelogging.info('Thread Object (%d):(%d), > Time:%s in s

Re: multiple threads with Logging: ValueError: I/O operation on closed file

2008-11-10 Thread Vinay Sajip
On Nov 8, 10:52 pm, [EMAIL PROTECTED] wrote: > OS: Solaris 9 > Python Version: 2.4.4 > > I need to log certain data in a worker thread; however, I am getting > an error now when I use two worker threads. > I think the problem comes from the linelogging.info('Thread Object (%d):(%d), > Time:%s in s

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-23 Thread Paul Rubin
Jp Calderone <[EMAIL PROTECTED]> writes: > >Secondly, I don't know about wxPython, but in tkinter you have to > >resort to a kludge in order for the gui thread to handle gui events > >and also notice stuff on a queue. There's a tkinter command to run > >some function after a specified time (say 50

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-02 Thread Paul Rubin
"fo" <[EMAIL PROTECTED]> writes: > Thanks for the replies. I have a Queue object in the main GUI thread, > this gets passed to all the worker threads and they add items to it. > This is all well and good, but what is a good way to get the GUI thread > to send items back to the worker threads?

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-02 Thread fooooo
Thanks for the replies. I have a Queue object in the main GUI thread, this gets passed to all the worker threads and they add items to it. This is all well and good, but what is a good way to get the GUI thread to send items back to the worker threads? -- http://mail.python.org/mailman/listinfo/p

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread M.E.Farmer
Look inthe demo that comes with wxPython it is in tree process and events -> threads . There is a nice demo of PostEvent(). Another way would be to use Queues as others have mention . You can create a new frame and have it call the queue for data. M.E.Farmer -- http://mail.python.org/mailman/li

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread John Perks and Sarah Mount
"fo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a network app, written in wxPython and the socket module. This > is what I want to happen: I'm not sure if this will help you, but it solved what was, for me, a more general problem: not (normally) being able to issue w

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Jp Calderone
On 01 May 2005 10:09:56 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "fo" <[EMAIL PROTECTED]> writes: How would I get the worker thread to open a GUI window in the main GUI thread? After that GUI window is open, how can I send and recv messages from/to the GUI window? First of all

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread Paul Rubin
"fo" <[EMAIL PROTECTED]> writes: > How would I get the worker thread to open a GUI window in the main GUI > thread? After that GUI window is open, how can I send and recv messages > from/to the GUI window? First of all the favorite Pythonic way to communicate between threads is with synchroniz