Closed

c++ producer/ consumer async update char* from Thread A, read latest update from Thread B

Looking for a way to asynchrously update a char* and bool from one thread, while getting the latest update in a separate thread. Needs to be efficient and thread safe. I'm a .net developer and not very familiar with concurrent programming in c++. Here is a sample class describing what I need to be able to do

#pragma once

#include <string>

class TestClass

{

public:

////////////////////////////////////////////////////////

// Called from Thread 1 Producer

void UpdateStrA(const char * msg)

{

pre_msg = _strdup(msg);

}

// Called from Thread 1 Producer

void UpdateB(const char* msg)

{

if (msg == "t")

b_do_stuff = true;

else

b_do_stuff = false;

}

////////////////////////////////////////////////////////

////////////////////////////////////////////////////////

////////////////////////////////////////////////////////

////////////////////////////////////////////////////////

// Called from Thread 2 Consumer

void CheckUpdateA()

{

std::string sMsgFull = pre_msg + std::string(" msg append");

// now we will send full message

}

// Called from Thread 2 Consumer

void CheckUpdateB()

{

if (b_do_stuff)

DoStuff();

}

////////////////////////////////////////////////////////

private:

void DoStuff(){}

char* pre_msg = new char[1];

bool b_do_stuff = false;

};

Skills: C++ Programming, C Programming

See more: c++ background thread, c++ create multiple threads, c++ pthread vs thread, c++ thread, mutex c++, thread join c++, c++ semaphore, c++ multithreading, shared buffer producer consumer, unix fork processes producer consumer, producer consumer problem files, project producer consumer problem, producer consumer code fork, producer consumer problem unix, producer consumer unix, producer consumer problem in c using semaphores and threads, producer consumer problem in c using queue, producer consumer problem in c linux, producer-consumer problem in c using pthreads/bounded-buffer/semaphore, producer consumer problem in c using threads

About the Employer:
( 16 reviews ) Nashville, United States

Project ID: #21630911

15 freelancers are bidding on average $40 for this job

vano101

Hello I have over 17 years of experience with C++ and Windows Desktop application development Also, I am familiar with multi-threading/concurrency too, There are few questions: What is target OS? What is compiler More

$33 USD in 1 day
(1422 Reviews)
7.7
utkarshkatiyar19

Hi, I'm an expert in multithreading C++ programming. I'm sure that I can easily do this project for you. We can have a chat about it. Thanks.

$60 USD in 2 days
(369 Reviews)
7.3
vahid01

Hi, i can help you.

$40 USD in 1 day
(84 Reviews)
6.0
iridescent2x15

Hi I am software engineer and have done many c and c++ programming projects. You can share more details with me so that we can negotiate the price accordingly. Thank you

$60 USD in 7 days
(54 Reviews)
5.8
vedant2910

I have a major in Computer Science. I know operating system concepts and I know how to use shared memory to achieve concurrency between threads. I have done various projects in C++ as you can see in my reviews. I will More

$40 USD in 1 day
(15 Reviews)
3.9
umairali8062

I have read your project and I am expert in this field. I can do this for you within due time and honestly. I also have a few questions to discuss. Kindly contact me and we will discuss time and budget. Thanks

$35 USD in 7 days
(8 Reviews)
3.6
wangzy840101

***Hello***. I am very excited to that I can bid for your project. I am C++/C# expert. I have developed many C++/C# software like auto trader, google finder, prescription etc. Especially I have my own desktop applicat More

$40 USD in 2 days
(3 Reviews)
2.9
oscardavids

Hi. I am oscar. I am very happy to read your proposal and I am the right person for your project. I have enough experiences with c/c+, c# more than 8 years. I 'm sure that I can do it successfully. Regards.

$50 USD in 1 day
(6 Reviews)
2.3
MrxMartino

I have >3 years of professional experience in C++ software that used a lot of concurrent programming. This was also mixed together with C# (C++ CLI) so I think I can do it for you. If interested please contact me. The More

$41 USD in 1 day
(2 Reviews)
2.0
iphonedev118

Dear sir I have already studied your task in detail. I'm an expert in c/c++, algorithm and its data structure, windows app. I'm sure i can make result for a few hrs. Thanks, sir Waiting for your reply...

$35 USD in 1 day
(3 Reviews)
1.8
SadafTiger

I’m Full Stack developer with vast experience in C++, Java, C and ReactJs, React Native, Redux, Flux, Node Js,Express Js, MongoDB,MySQL Bootstrap, Web Pack. And working experience with design tool kits: Microsoft Fabr More

$60 USD in 7 days
(0 Reviews)
0.0
kalyanprakash123

please discuss, keen to do it. negotiable price................................................................................

$40 USD in 2 days
(0 Reviews)
0.0
pankajkr505

Hello Sir/Madam, Greetings !! I went through your requirement and completely understood it. Mainly what I understood is that you have producer-consumer problem where synchronization is goal. Since I have expertise in More

$15 USD in 2 days
(0 Reviews)
0.0
zeeshujmi

Hi Buddy, I am a Systems Programmer and also worked for multithreaded application on backend for almost 6 years and made several projects. I have experienced in POSIX for multithreading. I got the consumer producer pr More

$25 USD in 1 day
(0 Reviews)
0.0
TalhaAli9

I have studied the attached [login to view URL] you want help , feel free to contact. I would like some details about the work.

$30 USD in 2 days
(0 Reviews)
0.0