Peruttu

Write some software

I need you to develop some software for me. I would like this software to be developed for Linux using C or C++. Topic 2: MULTITHREADED READER-WRITER PROBLEM

Overview:

The goal of this project is to learn about synchronization techniques.

This project will simulate the synchronization problem of several Readers (each reader is run in a separate thread)

and Writers (each writer is run in a separate thread) accessing the same file (writers has to access the file

exclusively while readers can read the file simultaneously; if a writer is writing to the file, no other

reader/writer can access the file; if a reader is writing to the file, no other writer can access the file while

other readers can still access the file). Writers write data into the file and Readers read data from the file.

Between [1 and 9] Readers each reader waits a random time from [0 to 1000] milliseconds, and then tries to read an

integer from the file.

Between [1 and 9] Writers each writer waits a random time from [0 to 1000] milliseconds, they then ties to write an

randomly generated integer into the file.

Random numbers will be produced using the rand() function, which produces random integers between 0 and

RAND_MAX.

The file can be created at the beginning with both read and write allowed, and 10 numbers should be written into the

file intially.

You can solve this problem using either Pthreads or the Win32 API. For more description and

directions, please refer to the textbook(chapter 4).

Your Task

In this project, you need to simulate the producer-consumer problem using three techniques out of the following:

o Semaphore(required),

o Monitor,

o global variables,

o hardware instructions (Test-and-Set etc.),

o peterson's algorithm etc.

Compare these three synchroniation techniques and see if they are sufficient to solve this problem.

Input Format

The simulator input includes three values:

How long to sleep before terminating

The number of reader threads

The number of writer threads

These three values should be read from the stdin.

Output Format

For each read/write action, an output line has this EXACT structure:

Integer #val (written/read) by (Writer/Reader) (writer/reader number)

file contents:

#val, #val, ..., #val

Submit:

Write a 2-3 page paper describing your project, what problems you've faced and how you've overcome them.

In your opinion, what is the best synchronization technique for producer-consumer problem? What are

practical limitations on that technique?

Is there race condition in your solution? If these is, describe why you cannot solve race condition.

What to submit:

Submit your test data.

Submit ALL source code with detailed instructions on how and where to compile it, and how to make it run. You

should submit a Makefile to build your code under GCC/G++ (recommended), Java, or whatever language you use.

Note that Visual C++ also supports Makefiles, so if you use that, you can still export a makefile. I will test some of

the code to make sure the numbers are not imagined.

Submit your paper describing the project.

Submit a file named: [url removed, login to view] that describes what and where all the information is stored. (which file does

what, etc.). This is mostly so that I don't get lost in your project directory.

Note: All descriptions and text should be in TEXT format. Do NOT submit MS Word documents, etc. Everything

has to be readable without any special programs. (If something "has" to be formated, use PDF).

You may use any language you wish, but you need to document what language you're using and how to compile

code somewhere in your submission. Also comment your code! If I can't read it, it's wrong!

When submitting, you're very likely to have many files. You can compress them into a [url removed, login to view] or zip and submit that.

Tips: For many of you, this may be the first time to work on multithread programming. It helps to organize the code

from the start, to document everything, etc. Make the code readable (not just for you, but for me as well).

Modularize your code. Work on 1 thing at a time. Start by reading the input, producing producer threads and

consumer threads , writing the main function. Then implement semaphore synchronization technique, make sure that

works well, then implement another synchronization techinique, etc.

And most importantly: Organize and design the project and know what you're doing before you start coding. (and

don't wait until the last weekend to do it)

Taidot: C-ohjelmointi, C++ -ohjelmointi, Linux, tietojärjestelmäarkkitehtuuri

Näytä lisää: export data image visual foxpro9, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, export mysql excel visual basic, software write books, software write protection, export datatable excel visual 2005, free software write book, software write book, export excel class visual basic net, software write protect software, software write technical manual

About the Employer:
( 0 reviews ) piscataway, United States

Projektin tunnus: #14082479

38 freelanceria on tarjonnut keskimäärin 1341 $ tähän työhön

Yknox

Hello I'm interesting your project very well I'm a Good C/C++, Java, Linux, Math, Algorithm expert. I m quite well experienced in these jobs. Let's go ahead with me I want to service for you continously. T Lisää

1200 $ USD 20 päivässä
(560 arvostelua)
8.6
srinichal

I am an expert in delivering custom softwares and scripts with a proven track record, ready to discuss further details

916 $ USD 20 päivässä
(139 arvostelua)
7.3
hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Lisää

750 $ USD 6 päivässä
(123 arvostelua)
6.9
TopTower22

hello,how are you. i read your bid carefully. i am c/c++ expert and have full experience for 10 years. c++ language is my top skill. i can provide most quality and high speed. if you want to success, please contact Lisää

1250 $ USD 20 päivässä
(76 arvostelua)
6.9
ggrig

Hello, And thanks for the detailed requirements on the project. This basically looks like an academic exercise on multi-threading and I'll be happy to help you with it. Some questions: - You say "For more descr Lisää

1000 $ USD 20 päivässä
(27 arvostelua)
6.7
zainy01

Hi! I m interested in it, I have highest reviews for jQuery (frontend) at [url removed, login to view] and have good completion rate. Experts in PHP(Laravel ,Yii ,Symfony, cakephp ,CI, Zend) for Server side, and integrating (SOAP a Lisää

1125 $ USD 10 päivässä
(20 arvostelua)
6.7
1250 $ USD 20 päivässä
(134 arvostelua)
6.2
A2Design

Hi, this looks like something we could help you with. Our team is Russian-Canadian. We specialise in: PHP & PHP frameworks, WordPress & Woocommerce, Opencart, Magento, API development, HTML5, CSS, JavaScript, Bootstrap Lisää

1500 $ USD 15 päivässä
(14 arvostelua)
6.6
WienFuJong

Hello Dear How are you? I have experience with c++ development for 6 years I can implement your idea. I will provide you good quality. Let's discuss in detail

1184 $ USD 20 päivässä
(10 arvostelua)
6.3
750 $ USD 10 päivässä
(117 arvostelua)
6.0
tudiptechnology

Hi, Let me keep this really short as I am sure you would be swamped with the proposals! We have proven track record of delivering C#/.Net web applications with AngularJS front end. Few applications that we w Lisää

1250 $ USD 45 päivässä
(4 arvostelua)
5.9
prashushinde9

I want to discuss this project with you further, let me know the best suitable time for you to schedule the meeting, Feel free to message me at any time, i used to be online 14 hrs in a day on this website so probably Lisää

1546 $ USD 40 päivässä
(19 arvostelua)
6.2
jigneshlakhani0

I, Jignesh Lakhani completed my masters from IIT Roorkee in Computer Engineering. I am having very good knowledge of C, C++, Java, JavaFX, Algorithm and Data Structure. I am having strong analytical power. I will comp Lisää

998 $ USD 20 päivässä
(20 arvostelua)
5.5
1000 $ USD 10 päivässä
(45 arvostelua)
5.7
750 $ USD 15 päivässä
(24 arvostelua)
5.0
endivesoftware

*** All ready Developed Application / Website / Software ** Actual Cost Varies According to Project Requirement *** Expert In Website / application Development *** Hello Client, Hope You are doing well! I have Lisää

7216 $ USD 45 päivässä
(4 arvostelua)
4.9
grtdeveloper

Rich Experience in writing multi threaded application using c,C++, python on linux an windows for many projects.

1333 $ USD 7 päivässä
(12 arvostelua)
4.6
mxicoders

Dear Sir/Ma'am, We possess 14 years of experience in I.T. Field and running MXI Coders Pvt Ltd (INDIA), Our strengths are in Web Designing, Web Development using -HTML 5, Flash, HTML/CSS/CSS3 web pages -Cloud c Lisää

1055 $ USD 15 päivässä
(2 arvostelua)
5.1
king18yat

1.) With my Skills, I can provide website , custom solution , e-commerce solution , android application , ios application , desktop application, games, SEO with one year support . 2.) I am available on all days to Lisää

1500 $ USD 30 päivässä
(1 arvostelu)
4.1
lxqcad

I have recently completed a c program using semaphores and monitor to aid a stanford university student in her academic submission. The program was to copy one file to another using multiple threads in Linux. I already Lisää

800 $ USD 5 päivässä
(7 arvostelua)
4.3