Help me solve C++ code

Anulat Postat la acum 4 ani S-au achitat serviciile după ce au fost prestate
Anulat

I'm looking for a very experienced C++ developer.

I'm trying to learn multithreading basics for image processing in C++. I come from a different API background where I've done this often and I'm trying to get my code ported to C++ using the std::thread function. This is my current pseudocode:

static const int num_threads=4;

void FilterImage (int x1, int x2, int x3, int threadNr) {

// output defined...

// Every thread calculates a different line

for (int y = 0 + threadNr; y < output->height; y += num_threads) {

// Horizontal lines

for (int x = 0; x < output->width; x++) {

// Do Stuff...

}

}

}

int main() {

std::thread t[num_threads];

int param1, param2, param3;

int i;

for (i = 0; i < num_threads; i++)

t[i] = std::thread(FilterImage, param1, param2, param3, i);

for (i = 0; i < num_threads; i++)

t[i].join;

}

However, I cannot get this to work. I cannot pass i (the thread Id) as a parameter to my function. Visual Studio won't allow me and reports an error.

I would like to hire someone to guide me through solving this and helping me understand why. I am quite new to C++. We would chat over the website chat and I would get your assistance that way.

I would like to retain this method for multitasking since it is a port from my other API. My expectation is to have each thread tackle an image line.

I will most likely have other issues I will need help on so I am looking for someone to have on-hand for other problems.

Algoritm Programare C Programare C# Programare C++ Arhitectură software

ID Proiect: #19630056

Detalii despre proiect

5 propuneri Proiect la distanță Activ acum 4 ani

5 freelanceri plasează o ofertă medie de 18$/oră pentru proiect

fastestJohn

Hello. I have just read your proposal in detail. I am very interested in your project. I am a C and C++ expert as you can see through my reviews. I have rich experiences and have taken part in programming contests. So Mai multe

$40 USD / oră
(73 recenzii)
6.4
marianakuzmich

Hell, dear... How are you? I just read your requirements. I feel very confident in your project because I am talented C/C++ developer with 8+ years. If you give me a chance, i'm going to work perfectly. I'll wait Mai multe

$10 USD / oră
(38 recenzii)
5.3
BestService222

Dear, Sir. Nice to meet you. Thank you for taking the time to read my proposal. I read your project description carefully and am very interested in working for your project. I am able to provide the best product w Mai multe

$7 USD / oră
(22 recenzii)
5.0
grigorywazin

Hi. I am a Senior Software Engineer with 12+ years of rich experience in C/C++ & Image Processing. I am very confident about this job and I can provide you with perfect help. Looking forward to discussing more in de Mai multe

$20 USD / oră
(11 recenzii)
5.6