BIPS/Examples/C++: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>
{{BIPS/Head|previous=|next=}}
</noinclude>
'''One to one example'''
'''One to one example'''


Line 53: Line 57:
                             NUM-ITERATIONS can be a positive integer
                             NUM-ITERATIONS can be a positive integer
</pre>
</pre>
<noinclude>
{{BIPS/Foot||}}
</noinclude>

Revision as of 19:49, 14 December 2022



  Index  





One to one example

Example using Command Line Interface (CLI). Remember the project structure necessary:

|- src
       |- examples
           |- one-to-one
               - consumer
               - producer

So, move into one-to-one folder. Using the following command:

cd src/example/one-to-one

Execute in different terminals a producer and consumer. In both cases, you can change or use some arguments. If you want to know what options you can be used, execute:

./producer -h

Then, the arguments and information of use will be returned:

Usage:
         producer [OPTION]...
Optional arguments:
         -h, --help: Display this message and exit
         --backend BACKEND: Use the specified inter-process shared memory
                            backend; BACKEND can be 'shm' or 'nvsci'
         --channel CHANNEL: Connect to the specified shared memory channel.
                            CHANNEL preferably starts with a '/' character
                            followed by up to 255 characters, none of which
                            are slashes
         --num-buffers NUM_BUFFERS: Indicate how many shared memory buffers
                                    to create; NUM_BUFFERS can be a positive
                                    integer
         --buffer-size BUFFER_SIZE: Indicate the size in bytes of a shared
                                    memory buffer; BUFFER_SIZE can be a
                                    positive integer
         --exec-order ORDER: Follow execution order for buffer processing
                             specified in ORDER; ORDER can be 'in-order' or
                             'out-of-order'
         --process-size PROCESS_SIZE: Indicate the size in bytes of data to
                                      write to/read from shared memory
                                      during execution; PROCESS_SIZE can be
                                      a integer smaller than BUFFER_SIZE
         --timeout TIMEOUT: Indicate how long to wait for available buffers
                            before throwing a timeout error; TIMEOUT is
                            measured in seconds and can be a positive
                            integer
         --num-iterations NUM-ITERATIONS: Indicate how long many buffer
                            processing iterations to run before exiting;
                            NUM-ITERATIONS can be a positive integer



  Index