Find Jobs
Hire Freelancers

Write a C program that creates two threads and runs them simultaneously

$10-30 USD

Completed
Posted almost 3 years ago

$10-30 USD

Paid on delivery
Write a C program that creates two threads and runs them simultaneously. Yarns will run on a global array and perform a cumulative addition. The total will be kept on a global value. One of the threads must run in the sequence from beginning to end, and the other from end to beginning. Each thread will read a single value and add to the global sum. Since threads operate on a common variable, you need to edit the access rights to this value using a semaphore. Also, you should not forget to check if there are any elements to be read in the array. The size of the directory will be taken from the user. A random array of numbers (0-9) will be created according to the entered dimension value. The created sequence will be printed on the screen. You can examine the pthread_create and pthread_join commands in the pthread library for thread formation and usage. Sample input and program output should be as follows. Example Input: 10 Sample Output (Running sequence of threads can be different at each run): Random Sequence => 4 2 8 1 5 3 7 9 6 9 Thread1 read the value of 4 total = 4 Thread1 read the value of 2 total = 6 Thread2 read the value 9 total = 15 Thread1 read the value of 8 total = 23 Thread2 read the value of 6 total = 29 Thread2 read the value 9 total = 38 Thread2 read the value 7 total = 45 Thread1 read the value of 1 total = 46 Thread2 read the value of 3 total = 49 Thread2 read the value of 5 total = 54 Thread2 could not find the value to be read. Note: Write a C / C ++ program that does all these operations. To run your program (for C code): gcc StudentNumber.c --lpthread ./[login to view URL]
Project ID: 30226136

About the project

5 proposals
Remote project
Active 3 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I'm in last year of BSCS. And i have best command in these languages plus. Plus your query is so well explained and understandable.
$15 USD in 6 days
5.0 (1 review)
0.4
0.4
5 freelancers are bidding on average $30 USD for this job
User Avatar
Since 2015 I am working in C/C++ programming. So more than 5(five) years of experience in C/C++ programming. I can build any function or method for you. If you want a good delivery of the project, then send me a message, please.
$50 USD in 2 days
5.0 (20 reviews)
5.7
5.7
User Avatar
Dear Sir. As an experienced algorithm expert, it is very interesting to me. I have been working on several data structure & algorithm projects such yours for over 7+ years. Since having programming contestant experience, I have powerful algorithm skills and full knowledge on several languages on such as c/c++, python, java, etc... I think i could be the right person for your project, because of my past experience and skills. I would be very appreciated if i have a chance to show you how could i help you to meet your goals. Thank you.
$40 USD in 1 day
4.6 (19 reviews)
4.8
4.8
User Avatar
Hello, Hi.. I can help you writing the code with two threads. I'm good at programming and coding in C, Python, C++ and bash.... Let me know, if you need my help. I'd like to help you. :) _______________________ ABOUT ME _______________________ Hi I'm IIT CSE Student Have excellent skills in python.. Web Scrapper... Excellence in automation.. And good at automating excels, spreadsheets.. done many projects before.. > Scripted Google App Script to get data From IMDB API > Scripted Google App Script to send mails from Google spreadsheets > Scripted Google App Script to customized save data in Google Drive from Google sheets > Scripted Google app script to make UserInterface in HTML from Google sheets data > Scraped 1,00,000 Instagram Profiles of specific category > Scraped Linkendin emails (linkedin uses best anti scraping tool) > Scraped G Suite, Marketplace and many more.. > Scraped 30,000 doctors details from practo.com.. > Scraped 5k products from JioMart And automated them in a Google Spread Sheets.. > Automated a huge task with selenium using multi processing If you are interested, please contact me.
$25 USD in 1 day
5.0 (10 reviews)
3.3
3.3

About the client

Flag of TURKEY
Ankara, Turkey
5.0
1
Payment method verified
Member since Oct 27, 2020

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.