Thread synchronisation : GUI

Hi everyone ,
I have a problem please someone suggest me how to solve my problem.I have a GUI which displays some realtime data in a column A , now the data is
read from a fifo file located in /tmp.Now when i read the data from the fifo file alone it is working properly, now a problem has come up.I want to add one more

column B which will display a value after manipulating the data present in the fifo file .Now both the column A and B are to be displaying and converting the same data
which is present in real time in fifo file and should not be like it reads the different content in the fifo …since it real time the data is been updated continously,

Hope you understand the problem for the realtime data.Now my real problem is that i am using a worker thread to read and update my GUI, i am not understanding
how i gonna do by synchronising the threads.
Please do guide me.

Thanks
Anil ph

You just need to use one of wxPython thread-safe methods to update the
GUI from the worker thread. See one or more of the following links for
details:

http://wiki.wxpython.org/LongRunningTasks

···

On Aug 2, 11:13 am, Anil Sharma <ph.anilsha...@gmail.com> wrote:

Hi everyone ,
I have a problem please someone suggest me how to solve my problem.I have
a GUI which displays some realtime data in a column A , now the data is
read from a fifo file located in /tmp.Now when i read the data from the fifo
file alone it is working properly, now a problem has come up.I want to add
one more
column B which will display a value after manipulating the data present in
the fifo file .Now both the column A and B are to be displaying and
converting the same data
which is present in real time in fifo file and should not be like it reads
the different content in the fifo ..since it real time the data is been
updated continously,
Hope you understand the problem for the realtime data.Now my real problem is
that i am using a worker thread to read and update my GUI, i am not
understanding
how i gonna do by synchronising the threads.
Please do guide me.

Thanks
Anil ph

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Thanks mike ,
I read thru the links u have replied for thread synchronisation and long running process in wxpython, now my problem is that a fifo file accepts a signal data coming from a device.The thing is that i am executing two file which does different things by using seperate subprocess call.Now since the fifo file holds the realtime data i cant simultaneously read a block from my threads as , if one waits for sometime ,the block of data at that time will not be available for the other thread in waiting.can you help me out how we can do this.

Thanks for you concern.

regards
anil ph.

···

On Mon, Aug 2, 2010 at 10:55 PM, Mike Driscoll kyosohma@gmail.com wrote:

On Aug 2, 11:13 am, Anil Sharma ph.anilsha...@gmail.com wrote:

Hi everyone ,

I have a problem please someone suggest me how to solve my problem.I have

a GUI which displays some realtime data in a column A , now the data is

read from a fifo file located in /tmp.Now when i read the data from the fifo

file alone it is working properly, now a problem has come up.I want to add

one more

column B which will display a value after manipulating the data present in

the fifo file .Now both the column A and B are to be displaying and

converting the same data

which is present in real time in fifo file and should not be like it reads

the different content in the fifo …since it real time the data is been

updated continously,

Hope you understand the problem for the realtime data.Now my real problem is

that i am using a worker thread to read and update my GUI, i am not

understanding

how i gonna do by synchronising the threads.

Please do guide me.

Thanks

Anil ph

You just need to use one of wxPython thread-safe methods to update the

GUI from the worker thread. See one or more of the following links for

details:

http://wiki.wxpython.org/LongRunningTasks

http://www.blog.pythonlibrary.org/2010/05/22/wxpython-and-threads/


Mike Driscoll

Blog: http://blog.pythonlibrary.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I thought you were just reading from one file and putting that data
into column A. Then you do a calculation on item one in column A and
put the result in column B, right? In your thread that reads the file,
have it read it AND do the calculations and then pass it all back to
your main GUI thread. You could create a dict with the keys being what
goes in Column A and the values go in Column B.

Or you could use the Queue method that was mentioned on the wiki. Put
stuff on the Queue and have your GUI thread check the Queue
periodically and update itself appropriately.

···

On Aug 2, 12:49 pm, Anil Sharma <ph.anilsha...@gmail.com> wrote:

Thanks mike ,
I read thru the links u have replied for thread synchronisation and long
running process in wxpython, now my problem is that a fifo file accepts a
signal data coming from a device.The thing is that i am executing two file
which does different things by using seperate subprocess call.Now since the
fifo file holds the realtime data i cant simultaneously read a block from
my threads as , if one waits for sometime ,the block of data at that time
will not be available for the other thread in waiting.can you help me out
how we can do this.
Thanks for you concern.

regards
anil ph.

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Thanks Mike for the immediate reply,
i will try to implement the queue in my program and return back .

Thanks mike again.
regards
anil ph

···

On Mon, Aug 2, 2010 at 11:36 PM, Mike Driscoll kyosohma@gmail.com wrote:

On Aug 2, 12:49 pm, Anil Sharma ph.anilsha...@gmail.com wrote:

Thanks mike ,

I read thru the links u have replied for thread synchronisation and long

running process in wxpython, now my problem is that a fifo file accepts a

signal data coming from a device.The thing is that i am executing two file

which does different things by using seperate subprocess call.Now since the

fifo file holds the realtime data i cant simultaneously read a block from

my threads as , if one waits for sometime ,the block of data at that time

will not be available for the other thread in waiting.can you help me out

how we can do this.

Thanks for you concern.

regards

anil ph.

I thought you were just reading from one file and putting that data

into column A. Then you do a calculation on item one in column A and

put the result in column B, right? In your thread that reads the file,

have it read it AND do the calculations and then pass it all back to

your main GUI thread. You could create a dict with the keys being what

goes in Column A and the values go in Column B.

Or you could use the Queue method that was mentioned on the wiki. Put

stuff on the Queue and have your GUI thread check the Queue

periodically and update itself appropriately.


Mike Driscoll

Blog: http://blog.pythonlibrary.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en