473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
Jul 22 '05 #1
6 1440
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...

Jul 22 '05 #2
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...

Jul 22 '05 #3
thanks your advice
i thinked the comp.lang.c++ group to all c++ related group

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:ZSIdc.108830$w54.775903@attbi_s01...
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...

Jul 22 '05 #4
thanks your advice
i thinked the comp.lang.c++ group to all c++ related group

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:ZSIdc.108830$w54.775903@attbi_s01...
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...

Jul 22 '05 #5
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
thanks your advice
i thinked the comp.lang.c++ group to all c++ related group
You thinked right. Your question was not C++ related.

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:ZSIdc.108830$w54.775903@attbi_s01...
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...


Jul 22 '05 #6
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
thanks your advice
i thinked the comp.lang.c++ group to all c++ related group
You thinked right. Your question was not C++ related.

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:ZSIdc.108830$w54.775903@attbi_s01...
"±è¿ë°Ç" <yg***@yujinrobot.com> wrote...
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...


Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ±è¿ë°Ç | last post by:
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...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
4
by: Leonardo Hyppolito | last post by:
Hello, I am trying to write a multithread program that simulates producers and consumers. My program can have many producers and many consumers (each in a separate thread). It has a storage...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
9
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But...
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
1
by: Bhavesh | last post by:
Hi Bruce, Thanks For Reply. U were right, Needed to pass string , but also need to pass size of Data( instead of 16, passed actual length of data). So that worked for me & didn't get any...
4
by: utab | last post by:
Dear all, I have to interface some C code in C++, but I had a problem with sscanf function, it has been some time I have not used C and I could not figure out my problem. Simple code is below, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.