Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

what does this c++ code do?

  • 18-06-2009 01: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,475 ✭✭✭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