473,795 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1460
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...

Jul 22 '05 #2
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...

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

"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:ZSIdc.1088 30$w54.775903@a ttbi_s01...
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...

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

"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:ZSIdc.1088 30$w54.775903@a ttbi_s01...
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...

Jul 22 '05 #5
"±è¿ë°Ç" <yg***@yujinrob ot.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.********@com Acast.net> wrote in message
news:ZSIdc.1088 30$w54.775903@a ttbi_s01...
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...


Jul 22 '05 #6
"±è¿ë°Ç" <yg***@yujinrob ot.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.********@com Acast.net> wrote in message
news:ZSIdc.1088 30$w54.775903@a ttbi_s01...
"±è¿ë°Ç" <yg***@yujinrob ot.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.programmin g.threads...


Jul 22 '05 #7

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

Similar topics

6
1033
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 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
18
6178
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 strcat (mystract). Program below. However this appears not to have fixed the problem and I don't know why it shouldn't ? Any further help as to what else I am doing wrong will be appreciated regards
4
6657
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 potential problems for thread-safety. So far, I'm only confused. I need a proper explanation for the concept so I can understand how to write thread-safe functions in the future. My apologies for posting a long routine.
4
1980
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 place (buffer) with "n" capacity. The user provides these parameters on startup. The buffer works with a circular queue. It's a console application. My implementation is working with Semaphores to synchornize everything. I think it's synchornized...
0
3942
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. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
9
2519
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 *after* calling increase_arrays(), I received segmentation fault. I tried to step it through gdb, and I found out that after calling increase_arrays(), words's original value is modified, and if I tried to access it, I get <address 0x11 out of...
17
4106
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
1826
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 error. But now problem in fetching, not able to fetch data from table correctly. Here is my code. I hav following problems with this coding
4
1710
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 am trying to read a file with line line 8 characters wide, 88888888 it has unix line ending LF, but I am getting a segfault from the sscanf
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9044
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.