Difference between revisions of "Example pthread demo"
(→2. Open the mcp4922_test project) |
(→What it does) |
||
Line 15: | Line 15: | ||
'''Usage for pthread_demo''' | '''Usage for pthread_demo''' | ||
− | pthread_demo | + | Usage: ./pthread_demo n<br /> |
+ | where n is the number of threads | ||
− | + | '''Usage example:''' | |
+ | |||
+ | ./pthread_demo 3 | ||
+ | |||
+ | Outputting to the terminal, the program will report that it created the random data and that the data was read from within the 3 pthreads. | ||
+ | |||
+ | Example session.<br /> | ||
+ | [[File:Pthread demo example terminal session.jpg|Example session.]] |
Revision as of 15:46, 14 November 2013
This procedure provides an overview of how to compile and run the pthread_demo C example project. It assumes familiarity with the C programming language and is intended to be used by experienced programmers who are looking to learn the EMAC SDK.
Contents
1. Open the C/C++ editing perspective
2. Open the pthread_demo project
3. Build, upload and run
What it does
This is a simple pthreads example application. A single thread is created to generate random data that is read by a specified number of reader threads.
Usage for pthread_demo
Usage: ./pthread_demo n
where n is the number of threads
Usage example:
./pthread_demo 3
Outputting to the terminal, the program will report that it created the random data and that the data was read from within the 3 pthreads.
Example session.
Example session.