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

Fab & Char Tech for Nanostru

by: Shyanne Lubowitz

Fab & Char Tech for Nanostru ECE 6960

Shyanne Lubowitz
The U
GPA 3.85


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 5 page Class Notes was uploaded by Shyanne Lubowitz on Monday October 26, 2015. The Class Notes belongs to ECE 6960 at University of Utah taught by Staff in Fall. Since its upload, it has received 46 views. For similar materials see /class/230013/ece-6960-university-of-utah in ELECTRICAL AND COMPUTER ENGINEERING at University of Utah.

Similar to ECE 6960 at The U



Reviews for Fab & Char Tech for Nanostru


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: 10/26/15
EOECS 3720 Embedded System Design ECE 69602 and CS 6968 Slide 1 Chris Jr Myers Lecture 12 Semaphores Introduction to Semaphores Semaphmes used to melement synchronization snarmg and co mmumcatlun between t e 5 Slide 2 e A semaphore Is a counter with two operamons e P or wait 7 V or signal 0 A meanmg ls assigned to each counter value 0 In a bmary semaphore 1 means free and 0 means busy Slide 3 Slide 4 SpinLack Semaphore Assembly for a SpinLock Counting Semaphore s rgml 1m s It semaphoze countez 1n1t to 1 make zeedemodmyewnce atomlc cuzzent value of semaphoze avallable 1 gt0 mncenupcs can occuz hezeM 8871 ss1gt thls ls atomlc Slide 5 Slide 6 C for a SpinLock Counting Semaphore struct sema4 int value semaphore value char s1 binary semaphore char s2 binary semaphore char s3 binary semaphore typedef struct sema4 sema4Type typedef sema4Type sema4Ptr C for a SpinLock Counting Semaphore cont void Waitsema4Ptr semaphore Wait ampsemaphoretgts3 Wait ampsemaphoretgtsl semaphoretgtvalue at ifsemaphoretgtvaluelt0 bSignalampsemaphoretgtsl Wait ampsemaphoretgts2 else bSignalampsemaphoretgtsl bSignalampsemaphoretgts3 Slide 7 Slide 8 C for a SpinLock Counting Semaphore cont void Signalsema4Ptr semaphore Wait ampsemaphoretgtsl semaphoretgtvalue ifsemaphoretgtvaluelt0 bSignalampsemaphoretgts2 bSignalampsemaphoretgtsl void Initializesema4Ptr semaphore int initial semaphoretgtsll first one to bWaitsl cont semaphoretgts20 first one to bWaits2 spins semaphoretgts3l first one to bWaits3 cont semaphoretgtvalueinitial Blocking Semaphore Slide 9 Slide 10 B locking Semaphore o In ia ze 1 Set the counter to its initial Value 2 Clear associated blocked tcb linked list 0 Va 1 Disable interrupts to make atomic 2 Decrement the semaphore counter7 8871 Slide 11 3 If semaphore counter lt 07 then block this thread 4 Restore interrupt status 0 Signak 1 Disable interrupts to make atomic Increment the semaphore counter7 SS1 2 3 If counter g 07 Wakeup one thread 4 Restore interrupt status Assembly to Initialize a Blocking Semaphore S rmb 1 Blocth rmb 2 Init tpa psha sei ldaa 1 staa S ldx Null stx Blocth pula tap rts semaphore counter Pointer to threads blocked on S Save old value of I Make atomic Slide 12 Init semaphore value empty list Restore old value of I Assembly to Block a Thread SWIhan ldx RunPt sts SPx Unlink quotto be blockedquot thread from RunPt list ldy Nextx find previous thread running process quotto be blockedquot save Stack Pointer in its TCB sty RunPt next one to run look cpx Nexty search to find previous beq found ldy Nexty bra look found ldd RunPt one after blocked std Nexty link previous to next to run Assembly to Block a Thread cont Put quotto be blockedquot thread on block list ldy Blocth sty Nextx link quotto be blockedquot stx Blocth Launch next thread ldx RunPt lds SPx set SP for this new thread ldd TCNT Next thread get time slice addd 20000 interrupt after 10 ms std TOCS ldaa 08 20 on the 6812 staa TFLGl clear OCSF rti Linked Lists X mbe Y Ilcme39un lmvmm ihlnckcd X Resource Sharing or Nonreentrant Code 0 Guarantee mutual exclusive access to a critical section Y X 0 be D Thead 1 Thread 2 Thread 3 Slide 13 Previous blocked quotexmmquot Slide 15 I bwait 85 bwait 85 bwaitamps TCB TCB printfquotbyequot printfquottchauquot priutf quotciaoquot quotIn be bln kcdquot already blocked bSigual 358 bSigual 358 bSigual 358 Y 4 TCB TCB Thread Communication Between Two Threads Thread Synchronization or Rendezvous 0 Thread 1 sends mail to thread 2 o Synchronize two threads at a rendezvous location Send Ack Meaning 31 S2 Meaning 0 0 No mail available consumer not waiting 0 0 Neither thread at rendezvous location 1 0 No mail available consumer is waiting Sllde 14 1 1 Thread 2 arrived rst waiting for thread 1 Sllde 16 1 1 Mail available and producer is waiting 1 1 Thread 1 arrived rst waiting for thread 2 Producer thread Consumer thread Thread 1 Thread 2 Mail4 wait Kaseud si alampSl si alampS2 gm gm signal Kcseud readMail wait 8682 wait 8681 wait Kcack signal Kcack Thread Communication Between Many Threads 0 In the bounded bu er problem many threads put data into and take out of a niteisize FIFOI PutFifo GetFifo wait XzRo omLeft wait XzCurrentS ize Slide 17 waitQa39nutex waitQa39nutex put data in FIFO remove data from FIFO signal szute x signal Wutex signalQLCurrentSize signal XzRoomLeft Could disable interrupts instead of using mutex but would lock out threads that don t a ect the FIFOI


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

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."

Anthony Lee UC Santa Barbara

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

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

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.