DOC PREVIEW
U of I CS 232 - Atomic Operations in Hardware

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

unsigned counter 0 void do stuff void arg for int i 0 i 200000000 i counter return arg unsigned counter 0 void do stuff void arg for int i 0 i 200000000 i counter return arg 1 2 3 6 5 77 1 4 8 counter 0 1 7 4 counter 4 9 counter counter lw t0 counter addi t0 t0 1 sw t0 counter lw t0 counter addi t0 t0 1 sw t0 counter lw t0 counter lw t0 counter addi t0 t0 1 lw t0 counter addi t0 t0 1 sw t0 counter counter addi t0 t0 1 sw t0 counter sw counter 77 t0 counter counter 2 1 1 2 A B 2C E 2 D A 7B 1 2 2C 2 6 F C 0 123 unsigned lock 0 spin lw bne li sw while 1 If lock 0 lock 1 break t0 t0 t1 t1 0 a0 0 spin 1 0 a0 7 G spin lw bne li sw t0 t0 t1 t1 0 a0 0 spin 1 0 a0 4 5 temp addr if temp old addr new else old temp x86 calls it CMPXCHG compare exchange Use the lock prefix to guarantee it s atomicity 6 7 3 lock acquire li t0 0 old li t1 1 new cas t0 t1 lock beq t0 t1 lock acquire sw t0 lock failed try again 1 1 4 H 2 2 I 2 A F 2 B


View Full Document

U of I CS 232 - Atomic Operations in Hardware

Documents in this Course
Goal

Goal

2 pages

Exam 1

Exam 1

5 pages

Exam 1

Exam 1

6 pages

Exam 2

Exam 2

6 pages

Exam 1

Exam 1

5 pages

Load more
Download Atomic Operations in Hardware
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Atomic Operations in Hardware and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Atomic Operations in Hardware 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?