Help ; problem in reading same FIFO file simultaneously using multi threading.

HI everyone,
I am having a small problem in reading a fifo file simultaneously.I am sending the output from a device to
a fifo file.now i have 3 threads running,
Thread 1; simply reads the file.
Thread 2; does a simple manipulation like decoding of the file
Thread 3; does another way of displaying the file.

what i want is that, these three thread must be able to read the file simultaneously and also should read the same block
of data in the FIFO file in the same time slot.The threads after that updates different indivisual parts in my GUI using wxCallAfter.
I implemented using multithread but My gui is halted , blocked and make my system to freeze.Please someone Guide me.
Thanks,

HI everyone,
I am having a small problem in reading a fifo file simultaneously.I am sending the output from a device to
a fifo file.now i have 3 threads running,
Thread 1; simply reads the file.

Given the nature of a fifo this would empty the fifo
Thread 2; does a simple manipulation like decoding of the file
Thread 3; does another way of displaying the file.

So these get nothing…

what i want is that, these three thread must be able to read the file simultaneously and also should read the same block
of data in the FIFO file in the same time slot.The threads after that updates different indivisual parts in my GUI using wxCallAfter.
I implemented using multithread but My gui is halted , blocked and make my system to freeze.Please someone Guide me.
Thanks,

···

From: ton ph

Sent: Monday, August 16, 2010 7:23 AM

To: wxpython-users@googlegroups.com

Subject: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Thanks for the reply steve , can you please suggest any means which i can fulfill this task, means simultaneously reading the
FIFO using multiple thread.So kind of u for ur guidance .Thanks for ur concern in advance.

···

On Mon, Aug 16, 2010 at 9:09 PM, GadgetSteve@live.co.uk wrote:

From: ton ph

Sent: Monday, August 16, 2010 7:23 AM

To: wxpython-users@googlegroups.com

Subject: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.

HI everyone,
I am having a small problem in reading a fifo file simultaneously.I am sending the output from a device to
a fifo file.now i have 3 threads running,
Thread 1; simply reads the file.

Given the nature of a fifo this would empty the fifo

Thread 2; does a simple manipulation like decoding of the file
Thread 3; does another way of displaying the file.

So these get nothing…

what i want is that, these three thread must be able to read the file simultaneously and also should read the same block
of data in the FIFO file in the same time slot.The threads after that updates different indivisual parts in my GUI using wxCallAfter.
I implemented using multithread but My gui is halted , blocked and make my system to freeze.Please someone Guide me.
Thanks,


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

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

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

Thanks for the reply steve , can you please suggest any means which i can fulfill this task, means simultaneously reading the
FIFO using multiple thread.So kind of u for ur guidance .Thanks for ur concern in advance.

Ton,

That is easy - you just need to have a single thread that does the reading into a buffer, (Thread 1), and then passes the buffer, or a copy of it, to the other 2 threads. The other threads will need to then process the buffer and enter an idle state waiting for the next block. Think of it as a branching pipeline. Note that updating the display should only be done from the main program, not a thread, so the processing threads should prepare the data for display and then mark it as updated and the main program should redraw the display when the data is marked as updated.

Gadget/Steve

···

From: ton ph

Sent: Tuesday, August 17, 2010 11:04 AM

To: wxpython-users@googlegroups.com

Subject: Re: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.

On Mon, Aug 16, 2010 at 9:09 PM, GadgetSteve@live.co.uk wrote:

From: ton ph

Sent: Monday, August 16, 2010 7:23 AM

To: wxpython-users@googlegroups.com

Subject: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.

HI everyone,
I am having a small problem in reading a fifo file simultaneously.I am sending the output from a device to
a fifo file.now i have 3 threads running,
Thread 1; simply reads the file.

Given the nature of a fifo this would empty the fifo

 Thread 2; does a simple manipulation like decoding of the file
 Thread 3; does another way of displaying the file.

So these get nothing…

what i want is that, these three thread must be able to read the file simultaneously and also should read the same block
of data in the FIFO file in the same time slot.The threads after that updates different indivisual parts in my GUI using wxCallAfter.
I implemented using multithread but My gui is halted , blocked and make my system to freeze.Please someone Guide me.
Thanks,


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Thanks steve , i will try to implement this logic in my multithreaded GUI application and in the process i will be able to learn also.Thanks steve for your genuine guide.And in future if any problem comes up in future please do not mind if i raise ask for help,Thanks again for ur concern.

···

On Tue, Aug 17, 2010 at 5:14 PM, GadgetSteve@live.co.uk wrote:

From: ton ph

Sent: Tuesday, August 17, 2010 11:04 AM

To: wxpython-users@googlegroups.com

Subject: Re: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.

Thanks for the reply steve , can you please suggest any means which i can fulfill this task, means simultaneously reading the
FIFO using multiple thread.So kind of u for ur guidance .Thanks for ur concern in advance.

Ton,

That is easy - you just need to have a single thread that does the reading into a buffer, (Thread 1), and then passes the buffer, or a copy of it, to the other 2 threads. The other threads will need to then process the buffer and enter an idle state waiting for the next block. Think of it as a branching pipeline. Note that updating the display should only be done from the main program, not a thread, so the processing threads should prepare the data for display and then mark it as updated and the main program should redraw the display when the data is marked as updated.

Gadget/Steve

On Mon, Aug 16, 2010 at 9:09 PM, GadgetSteve@live.co.uk > wrote:

From: ton ph

Sent: Monday, August 16, 2010 7:23 AM

To: wxpython-users@googlegroups.com

Subject: [wxPython-users] Help ; problem in reading same FIFO file simultaneously using multi threading.

HI everyone,
I am having a small problem in reading a fifo file simultaneously.I am sending the output from a device to
a fifo file.now i have 3 threads running,
Thread 1; simply reads the file.

Given the nature of a fifo this would empty the fifo

 Thread 2; does a simple manipulation like decoding of the file
 Thread 3; does another way of displaying the file.

So these get nothing…

what i want is that, these three thread must be able to read the file simultaneously and also should read the same block
of data in the FIFO file in the same time slot.The threads after that updates different indivisual parts in my GUI using wxCallAfter.
I implemented using multithread but My gui is halted , blocked and make my system to freeze.Please someone Guide me.
Thanks,


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

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

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