Re: Message between threads

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hmmm. Well, there are two of you, then. Maybe the forum is just a
front-end for the newsgroup. The question was talking about three threads,
GUI, sensor data, and data processing, sending data between the threads,
etc. Sure sounds like you...

Here's the original question from microsoft.public.windowsce.embedded.vc:

-----

hi all,

Here is my problem. I have three threads in my application. One is comm
thread that gets data from the sensors and stores it in a structure and
sets some variables if there is communication error. I need to send
this structure to algorithm thread where i do some math with the sensor
values stored in communication and i also set some variables that need
to passed to third thread graphics. So atlast the graphics has to get
messages from both comm and alg thread. I looked at some article abt
worker and gui thread and some disadvantages using postmessage and
sendmessage. I would really appreciate if somebody could advice me
regarding efficient way of passing my messages between threads. ANy
help is appreciated.

Thanks

-----

Read my reply there...

Paul T.

"wceess" <wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0A32B7B6-77CA-4F58-877D-894E16D255F0@xxxxxxxxxxxxxxxx
Hi paul,

I didnt post any question yesterday. I was searching in google on the
topic
message between threads and i came across a msdn forum which is not this.
I
posted my question and i received a email conformation saying my question
is
posted. I thought i would get an email if somebody replies to my question,
but i didnt get any. So i thought my question was not answered and i dont
know how i searched in google to post that question. I basically lost
track
of that. I didnt really mean to post that again and i am really sorry. Can
you plz paste the same answer again.

Thanks

"wceess" wrote:

Hi,

I am an embedded engineer having lot of experience in embedded C
programming. This is first time i am doing windows CE programming and i
have
learned a lot from this forum. My issue now is i create three threads
when i
enter into my application. All i need to do in my application is read a
sensor, do math on the sensor values and display GUI to user. So i
started
with creaing comm thread for sensor integration, and algorithm thread for
doing math with sensor values. On my comm thread i store all the sensor
values(which i receive every 40ms) into a structure and set a event
comm_done
where my algorithm thread starts by reading this structure and i have
used
critical section while reading this structure as i declared the structure
as
global. When algorithm thread is done i go to sleep for 40ms where by
background GUI thread starts.
My question are
1) Graphics threads gets only few messages so i thought i would declare
those messages as global and access them. Is this a gud thing to do?
2) What is an efficient way to pass messages between threads..how abt
postmessage which do not block on messages or openmsgqueue?

I need advice. Thanks
Ram


.



Relevant Pages

  • "error serializing COM object.." and mcc
    ... I'm building a program for fingerprint recognition. ... a gui I built. ... the fingerprint sensor is a "Secugen Hamster". ... since it works fine in the MATLAB enviroment, ...
    (comp.soft-sys.matlab)
  • Re: Message between threads
    ... sensor, do math on the sensor values and display GUI to user. ... where my algorithm thread starts by reading this structure and i have used ... Graphics threads gets only few messages so i thought i would declare ...
    (microsoft.public.windowsce.embedded)
  • Re: Canon 10D v Canon 350D
    ... I'm reading my way through the forum now - great advice! ... > you trigger the "clean sensor", ... the dust sticks to it. ...
    (rec.photo.digital)
  • Re: CANON 5D....
    ... >> Skip Middleton writes ... ... >>problems with dust than any other DSLR... ... > sensor), I would say it has to be cleaned about 4x as often. ... D30/D60/10D/20D forum. ...
    (rec.photo.digital)
  • Re: Canon 10D v Canon 350D
    ... > I'm reading my way through the forum now - great advice! ... >> is that the sensor can easily be affected by dust. ... the dust sticks to it. ...
    (rec.photo.digital)