11.07.2015 Views

Chapter 2 Real-Time Systems Concepts Foreground/Background ...

Chapter 2 Real-Time Systems Concepts Foreground/Background ...

Chapter 2 Real-Time Systems Concepts Foreground/Background ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• Accessing shared data by obtaining a semaphoreOS_EVENT *SharedDataSem;void Function (void){INT8U err;OSSemPend(SharedDataSem, 0, &err);.. /* You can access shared data in here (interrupts are recognized) */.OSSemPost(SharedDataSem);}2-29• Control of shared resources (multual exclusion)– e.g., single display devicetask1( ... ){...printf("This is task 1.");...}task2( ... ){...printf("This is task 2.");...}Results may be:ThiThsi siis ttasaks k12..Exclusive usageof certain resources(e.g., shared memory)2-30

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!