473,804 Members | 3,228 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 1033
"±è¿ë°Ç" <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
1461
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
6181
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
6661
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
1981
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
3945
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
2520
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
4107
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
1828
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
17
2161
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 64-bits of the pointer. does %l exist in both printf and scanf for this purpose ?
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
9588
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
10340
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...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2999
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.