Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

what does this c++ code do?

  • 18-06-2009 12:28AM
    #1
    Closed Accounts Posts: 7,132 ✭✭✭


    This is code used for an some register sharing technique for a low power vlsi design btw

    I am not sure what par > means ?

    does the while statement do all the following statements ?

    ie: receive data, multiply them, and send them to channel z ?


    [chan is for channel]


    also what does putint do ?

    ...... stdout, 10,0, x.

    this outputs 10,0, and the contents of x ?

    ................................................................................

    this is not home work or anything by the way, its interview preparation.

    thank you.


Comments

  • Registered Users, Registered Users 2 Posts: 6,477 ✭✭✭MOH


    Wild guess: par is running two threads in parallel?

    So in the first example, thread 1 loops continually receiving pairs of integers off channel i, calculating z = x squared - y squared, and putting z on channel ch

    Meanwhile thread 2 keeps pulling stuff off channel ch and sending it to channel o.


    Example 2, put 10 to channel ch, and in parallel read this and assign it to x.


Advertisement
Advertisement