HW3 - School of Electrical Engineering and Computer Science...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
School of Electrical Engineering and Computer Science University of Central Florida COP5611 - Advanced Operating Systems Spring 2009 (dcm) Homework 3. Due Wednesday February 18. Problem 1 (10 points) A computer does not have a swap instruction but has a test and set (TST). Can you write the procedure enterRegion using swap instead of TST? enterLock; TST R1, lock # Test and Set Register R1 CMP R1, #0 # Compare contents of R1 with 0 JNE enterRegion # if not equal jump to return Problem 2 (10 points) Provide an implementation of a counting semaphore using only a binary semaphore and ordinary machine instructions. Problem 3 (80 points) The number of ways of partitioning a set of elements into nonempty sets is also called a Stirling set number , or a Stirling number of the second kind . These numbers are denoted as S ( n,k ). For example, the set { 1 , 2 , 3 } can be partitioned into: three subsets in one way: {{ 1 } , { 2 } , { 3 }} ; two subsets in three ways: {{ 1 , 2 } , { 3 }} , {{ 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

HW3 - School of Electrical Engineering and Computer Science...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online