New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Computer Arch & Oper Sys

by: Cassidy Effertz

Computer Arch & Oper Sys ECE 3055

Cassidy Effertz

GPA 3.64


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course


This 0 page Class Notes was uploaded by Cassidy Effertz on Monday November 2, 2015. The Class Notes belongs to ECE 3055 at Georgia Institute of Technology - Main Campus taught by Yalamanchili in Fall. Since its upload, it has received 16 views. For similar materials see /class/233896/ece-3055-georgia-institute-of-technology-main-campus in ELECTRICAL AND COMPUTER ENGINEERING at Georgia Institute of Technology - Main Campus.



Reviews for Computer Arch & Oper Sys


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 11/02/15
http WWW csnmsu eduNj cookToolsp qreadsrw c k File rwc Title Demo ReadersWriter Short A solution to the multireader39s one writer problem Long Author Andrae Muys Date 18 September 1997 k Revised include ltpthreadhgt include ltstdiohgt include ltunistdhgt include ltstdlibhgt define MAXCOUNT 5 define READERl 50000 define READERZ 100000 define READER3 400000 define READER4 800000 define WRITERl 150000 typedef struct pthreadimutexit mut int writers int readers int waitin pthreadicondit writeOK readOK rwl rwl initlock void readlock rwl lock int d writelock rwl lock int d void readunlock rwl lock void writeunlock rwl lock void deletelock rwl lock void void typedef struct rw lock int id long delay rwargs rwargs newRWargs rwl l int i long d void reader void args void writer void args static int data 1 int main 0 pthreadit rl r2 r3 r4 Wl rwargs a a2 a3 a4 a5 rwl lock lock initlock al newRWargs lock 1 WRITERl pthreadicreate ampwl NULL writer al a2 newRWargs lock 1 READERl pthreadicreate amprl NULL reader a2 a3 newRWargs lock 2 READERZ 1 of4 7232007 926 AM http WWW csnmsu eduNj cookToolsp qreadsrw c pthreadicreate ampr2 NULL reader a3 a4 newRWargs lock 3 READER3 pthreadicreate ampr3 NULL reader a4 a5 newRWargs lock 4 READER4 pthreadicreate ampr4 NULL reader a5 pthreadijoin wl NULL pthreadijoin r1 NULL pthreadijoin r2 NULL pthreadijoin r3 NULL pthreadijoin r4 NULL free a1 free a2 free a3 free a4 free a5 return 0 rwargs newRWargs rwl 1 int i long d rwargs args args rwargs malloc sizeof rwargs if args NULL return NULL argsgtlock l argsgtid i argsgtdelay d return args void reader void args rwargs a int d a rwargs args do readlock agtlock agtid d data usleep agtdelay readunlock agtlock printf quotReader d Data dnquot agtid d usleep agtdelay while d l O printf quotReader d Finishednquot agtid return NULL void writer void argm rwargs a int i a rwargs args for i 2 i lt MAXCOUNT i writelock agtlock agtid data i usleep agtdelay writeunlock agtlock printf quotWriter d Wrote dnquot agtid i usleep agtdelay printf quotWriter d Finishingnquot agtid writelock agtlock agtid data O writeunlock agtlock printf quotWriter d Finishednquot agtid return NULL 2 of4 7232007 926 AM http WWW csnmsu eduNj cookToolsp qreadsrw c rwl initlock void rwl lock lock rwl malloc sizeof rwl if lock NULL return NULL lockgtmut pthreadimutexit malloc sizeof pthreadimutexit if lockgtmut ULL free lock return NULL lockgtwriteOK pthreadicondit malloc sizeof pthreadicondit if lockgtwriteOK NULL free lockgtmut free lock return NULL lockgtreadOK pthreadicondit malloc sizeof pthreadicondit if lockgtwriteOK NULL free lockgtmut free lockgtwriteOK free lock return NULL pthreadimutexiinit lockgtmut NULL pthreadicondiinit lockgtwriteOK NULL pthreadicondiinit lockgtreadOK NULL lockgtreaders 0 lockgtwriters 0 lockgtwaiting 0 return lock void readlock rwl lock int d pthreadimutexilock lockgtmut if lockgtwriters lockgtwaiting o printf quotreader d blockednquot dL pthreadicondiwait lockgtreadOK lockgtmut printf quotreader d unblockednquot d while lockgtwriters lockgtreaders pthreadimutexiunlock lockgtmut return void writelock rwl lock int d pthreadimutexilock lockgtmut lockgtwaiting while lockgtreaders lockgtwriters printf quotwriter d blockednquot d pthreadicondiwait lockgtwriteOK lockgtmut printf quotwriter d unblockednquot d lockgtwaiting lockgtwriters pthreadimutexiunlock lockgtmut return void readunlock rwl lock pthreadimutexilock lockgtmut lockgtrea ers pthreadicondisignal lockgtwriteOK pthreadimutexiunlock lockgtmut 3 of4 7232007 926 AM


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Anthony Lee UC Santa Barbara

"I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.