SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 2 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 30 Oct 2017 My Price 10.00

The producer should open an input file and repeatedly copy values to a circular buffe

Help please.

 

I need this to be done by

Tuesday 23rd August, 6:00PM

Programming Assignment

 

 

 

 

Create a console-based application that spawns two threads:  a producer and a consumer. Use any programming language.

 

The producer should open an input file and repeatedly copy values to a circular buffer.

 

The consumer should open an output file and repeatedly copy values from the same circular buffer to the file.

 

For both the producer and consumer, a random number of bytes between 1 and n, inclusive, should be copied each iteration, where n is specified by the user.  The number of bytes should be randomized each iteration.

 

If the producer is unable to write to the buffer (because it does not contain enough empty elements), or if the consumer is unable to read from the buffer (because it does not contain enough unread items), then it should proceed to the next iteration, choosing a new random number of bytes to copy.  (Exception:  Once the producer has already read the entire file, then the consumer does not have to continue generating random numbers until it gets an exact hit; instead, it should write the rest of the buffer to complete the copy.)

 

When the program completes, the output file should be an exact copy of the input file.

The syntax of the program should be as follows:

    copyfile input output n m

 


where


   
copyfile is the name of your executable
   
input is the name of the input file
   
output is the name of the output file
   
n is the maximum number of bytes to copy in any given iteration (described above)
   
m is the size of the circular buffer, in bytes

 

 

What to Hand In:

 

All programming files(whole solution).

 

Attachments:

Answers

(5)
Status NEW Posted 30 Oct 2017 11:10 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)