How Software Gets Done  


Login

Software Buyers
Request bids
Search coders
My Buyer Account
Buyer help
Buyer articles
Buyer FAQ
Latest news
 
Software Coders
Newest open work
Browse all work
Search all work
My Coder Account
Coder help
Coder articles
Coder FAQ
Latest news
 
Affiliates
My Affiliate Account
Affiliate help
Affiliate FAQ
Latest news
 
Newest Bid Requests.
(See all)
Create Robot.txt file
By franjavier on Sep 25
Max Bid: Open to fair suggestions


Heads or Tails(Coin Toss)
By bsshoomez on Sep 25
Max Bid: $25


CanUHelpMe - Redesign Logo and Home Page
By Webpak on Sep 25
Max Bid: Open to fair suggestions


Splash Screen Graphic
By Byoni on Sep 25
Max Bid: Open to fair suggestions


Better Property Grid/Form (c#)
By QUIET on Sep 25
Max Bid: Open to fair suggestions


Add recurring billing to Paypal IPN script
By linny on Sep 25
Max Bid: $20


Click here to put this ticker on your own site and/or get live RSS newsfeeds

Open Work Categories.
Database 
(187 open)
   Access 
(62 open)
   MySQL 
(122 open)
   Oracle 
(11 open)
   SQL Server 
(69 open)
   Other DB 
(24 open)
Documentation / Tech Writing 
(25 open)
   Language (Human) Translations 
(11 open)
Data Entry 
(37 open)
Game Development 
(22 open)
Graphics / Art / Music 
(56 open)
   Graphics 
(57 open)
     Adobe AfterEffects 
(12 open)
     Adobe Photoshop 
(33 open)
     Adobe Premiere 
(9 open)
     3d Animation 
(18 open)
   Art (Misc.) 
(17 open)
   Music 
(8 open)
   Photography 
(5 open)
   3d Modeling 
(11 open)
Language Specific 
(117 open)
   Assembly / Machine language 
(18 open)
   ASP 
(67 open)
   ASP .NET 
(73 open)
   C# 
(68 open)
   C++ / C 
(170 open)
   Carbon (Mac OS) 
(3 open)
   Cocoa / Obj-C 
(5 open)
   Cold Fusion 
(9 open)
   Delphi 
(56 open)
   Java 
(98 open)
   JSP 
(14 open)
   Perl 
(51 open)
   Python 
(6 open)
   PHP 
(124 open)
   XML/XSL 
(35 open)
   Visual Basic 
(171 open)
   Visual Basic .Net 
(111 open)
   Other 
(73 open)
Misc 
(39 open)
   Middleware 
(1 open)
   CAD 
(5 open)
MultiMedia 
(27 open)
   Video Editing 
(5 open)
Network 
(40 open)
   Network Design 
(7 open)
   Network Implementation 
(7 open)
Platforms 
(72 open)
   Windows 
(185 open)
     MS Exchange 
(11 open)
     MS Office 
(27 open)
     Other 
(16 open)
   Darwin 
(3 open)
   Embedded Systems 
(13 open)
   Hand Held/PDA Programming 
(18 open)
   Internet Browser 
(54 open)
   Linux 
(72 open)
   Lotus Notes / Domino 
(2 open)
   UNIX 
(43 open)
Requirements 
(11 open)
Security 
(41 open)
Testing / Quality Assurance 
(16 open)
Web 
(160 open)
   Page Design 
(81 open)
   Flash 
(48 open)
   Marketing 
(15 open)
     Search Engine Optimization 
(11 open)
     Marketing (Other) 
(14 open)
   Web Services 
(84 open)
   Web (Other) 
(94 open)
Training 
(12 open)
   Computer Based 
(11 open)
Other
 
Other Sites

Download the free Rent A Coder IE toolbar!
 
Show Bid Request

Producer/Consumer
Bid Request Id: 7480
Bookmark in my 'To Do' list
Posted by: shotglass (9 ratings)
(Software buyer rating 10)
Non-action Ratio: Above Average - 25.00%
Buyer Security Verifications: Good
Approved on: Jan 12, 2002
11:01:37 AM EDT
Bidding Closes: Jan 14, 2002
12:00:00 PM EDT
Viewed (by coders): 645 times
Phase:
100% of work completed and accepted. Coder has been paid.
Max Accepted Bid: Bidding is closed
Project Type: Personal Project / Homework Help
Bidding Type: Open Auction
Categories: C++ / C
Enter chat room for this bid request
(0 active users at Sep 25, 2003 9:10:47 AM EDT)

Description:
Program in ANSI C in UNIX
Producer/Consumer contains two types of processes. The first type, producers, create items and add them to a buffer that is shared among all processes. The second type, consumers, extract items from the shared buffer and do consume the extracted item. The buffer contains a finite number of slots to hold produced but not yet consumed items. If the buffer is full, no producer is allowed to add items to the buffer. If buffer is empty, no consumer is allowed to remove an item.
8 producers
12 consumers
buffer size of 5
Each producer and consumer will be a separate thread, created by the main() The buffer will be shared, globally declared queue implemented with a circular array of length 6, and will have 2 functions to modify it: enqueue() and dequeue(). Elements in the queue are ints. The signatures for these functions are:
void enqueue( int item );
int dequeue();

Access to the buffer variables(array, indices,etc.) is sequentialized with a mutual exclusion semaphore, mutex. You will also have 2 other semaphores named empty and full. The semaphores needed are:
mutex-initially set to 1, binary semaphore that is used to control access to the shared buffer.
empty-initially set to 5, counting seamphore that controls the number of producers that can concurrently add items to the shared buffer. It is decremented when a producer adds an item and incremented when a consumer extracts an item.
full-initially set to 0 counting semaphore controls the number of consumers that can remove items from the shared buffer. It is incremented after a producer adds an item and is decremented when a consumer extracts an item.
The following algorithms are to be used for the producer/consumer threads:
Producer::
Repeat 12 times
Randomly generate an int /*Produce an item*/
Print the generated integer
wait on empty /*wait if no empty slots*/
enqueue the int in buffer /* mutex needed*/
post on full /* allow other consumer*/

Consumer::
Repeat 8 times
wait on full /* wait if no items ready*/
dequeue the int from buffer/*mutex needed*/
post on empty /*allow another producer*/
/*show that it is consumed*/
Print the integer number

supposed to be an introduction program. Values can be hard-coded.

Deliverables:
code e-mailed to me

Special Conditions / Other:
The time deadline is Central Time Zone 9:00pm 1/14/02


Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements. We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation. If you notice a violation please help out the site and report it. Thanks for your help.
 
Bidding/Comments:
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests.

See all rejected bids (and all comments)
Name   Bid Amount 
 
Date   Coder Rating  
This bid was accepted by the buyer!
Sumegha Goyal
(14 ratings)
in Ghaziabad, Uttar Pradesh
India
Bid id: 85,575
 
$30 (USD) Jan 13, 2002
12:56:57 PM EDT
 10
(Excellent)
   
Hello Sir.
I have studied this producer-consumer problem completely. I know semaphores and have worked extensively in C/C++, so the code would be delivered on time and as per all requirements, with proper comments. Please close the bid at the earliest to allow sufficient time to code.
Regards. Sumegha.
 




Bid Request Search
 Advanced Search
Newest Open Work
Latest News  
Credentials


 

 
Rent A Coder upholds the rigorous business practices required to be both a BBB member and Square Trade vendor.
  • All customer issues addressed within 2 days
  • Openly disclosed pricing and return policies
  • Participation in mediation at buyer request
  • Superior selling track record
This site is verified through its parent company, Exhedra Solutions, Inc.
 
Top Coders.

Securenext
Rated a 9.97 on 124 jobs 
Buddies
Rated a 9.85 on 94 jobs 
Codman
Rated a 9.97 on 158 jobs 
hernest
Rated a 10 on 122 jobs 
Andrei Remenchuk
Rated a 10 on 14 jobs 
D-N-S
Rated a 9.93 on 39 jobs 
markesh
Rated a 10 on 23 jobs 
GribFritz
Rated a 9.89 on 152 jobs 
ASP.NET
Rated a 9.86 on 62 jobs 
PSergei
Rated a 9.77 on 108 jobs 

See all top coders...

(What makes a top coder?)

Top Exam Scorers

 
Other
Rent A Coder is PayPal verified through its parent company, Exhedra Solutions, Inc.

Created in partnership with:

 

Affiliate Sites
Latest News | About Us | Kudos | Feedback/Contact    Affiliates | Advertise    Privacy | Legal

Copyright © 2001, Exhedra Solutions, Inc. All rights reserved.
By using this site you agree to its Terms and Conditions.
"Rent A Coder" (tm), "Safe Project Escrow" (tm) and "How Software Gets Done" (tm)
are trademarks of Exhedra Solutions, Inc.