473,387 Members | 1,603 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,387 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 1019
"±è¿ë°Ç" <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...
17
by: let_the_best_man_win | last post by:
How do I print a pointer address into a string buffer and then read it back on a 64 bit machine ? Compulsion is to use string (char * buffer) only. printing with %d does not capture the full...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.