i have problem that two thread use one charactor pointer for string buffer

±

±è¿ë°Ç

my project has critical bug that TTS(text to speech) engine has two thread
one thread is socket thread that receives string from socket server and
other thread
is engine thread that processes the TTS(text to speech)

the received string is dynamically allocated (char * pRcvstr)
i think the bug occured when socket thread receives string buffer
while engine thread processes the other TTS,
because of two threads share one memory pointer

how to manager the resource that using two thread?
i thinked the criticalsection,
but this is useless overhead and has capability of other problem

i need a simple solution
 
V

Victor Bazarov

±è¿ë°Ç said:
my project has critical bug that TTS(text to speech) engine has two thread
one thread is socket thread that receives string from socket server and
other thread
is engine thread that processes the TTS(text to speech)

In this paragraph the only two words relevant to this newsgroup are
"bug" and "string". The rest has nothing to do with C++. Perhaps
you should try comp.programming.threads...
 
±

±è¿ë°Ç

thanks your advice
i thinked the comp.lang.c++ group to all c++ related group
 
V

Victor Bazarov

±è¿ë°Ç said:
thanks your advice
i thinked the comp.lang.c++ group to all c++ related group

You thinked right. Your question was not C++ related.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top