📄 readme_synchronizedemo.txt
字号:
FILE LIST - synchronizeDemo.cDESCRIPTION - This demo demonstrates the intertask synchronization using binary semaphores. It creates two (semId1 and semId2) binary semaphores for intertask synchronization between two tasks (taskA and taskB). taskA needs to execute an event (event A). On completion of event A, taskB needs to execute another event (event B). On completion of the event B, taskA needs to execute event A. This process needs to be done iteratively. SynchronizeDemo executes this process. To run the code invoke the function synchronizeDemo().RUNNING DEMO - Place the synchronizeDemo.c file in your <Tornado> dir. Depending on the target you have, define the CPU in your compile line and use the Makefile in the <tornado> directory to compile the code. Run synchronizeDemo () on vxworks target.TESTED ON - Host/Target : Solaris 2.5.1 / mv1604 VxWorks : 5.3.1 EXAMPLE COMPILE LINE - (use the Makefile in the BSP) make CPU=PPC604 synchronizeDemo.o% make synchronizeDemo.occppc -B/petaluma1/mayur/tor101-ppc/host/sun4-solaris2/lib/gcc-lib/ -mstrict-align -ansi -nostdinc -O2 -fvolatile -fno-builtin -fno-for-scope -Wall -I/h -I. -I/petaluma1/mayur/tor101-ppc/target/config/all -I/petaluma1/mayur/tor101-ppc/target/h -I/petaluma1/mayur/tor101-ppc/target/src/config -I/petaluma1/mayur/tor101-ppc/target/src/drv -DCPU=PPC604 -DMV1600 -DTARGET_DIR="\"mv1604\"" -c synchronizeDemo.cOUTPUTS/LOGFILE -On VxWorks target:==================-> ld <synchronizeDemo.o value = 708664 = 0xad038 = tcpstates + 0x28-> synchronizeDemovalue = 0 = 0x0The Output on Console:======================taskA: Started first by taking the semId1 semaphore - 1 timesThis is task <tTaskA> : Event A now donetaskA: I'm done, taskB can now proceed; Releasing semId2 semaphoretaskB: Synchronized with taskA's release of semId2 - 1 timesThis is task <tTaskB> : Event B now donetaskB: I'm done, taskA can now proceed; Releasing semId1 semaphoretaskA: Started first by taking the semId1 semaphore - 2 timesThis is task <tTaskA> : Event A now donetaskA: I'm done, taskB can now proceed; Releasing semId2 semaphoretaskB: Synchronized with taskA's release of smesThis is task <tTaskB> : Event B now donetaskB: I'm done, taskA can now proceed; Releasing semId1 semaphoretaskA: Started first by taking the semId1 semaphore - 3 timesThis is task <tTaskA> : Event A now donetaskA: I'm done, taskB can now proceed; Releasing semId2 semaphoretaskB: Synchronized with taskA's release of semId2 - 3 timesThis is task <tTaskB> : Event B now donetaskB: I'm done, taskA can now proceed; Releasing semId1 semaphore synchronizeDemo now completed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -