Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

what does this c++ code do?

Options
  • 18-06-2009 1:28am
    #1
    Closed Accounts Posts: 7,134 ✭✭✭


    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 Posts: 6,465 ✭✭✭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