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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

what does this c++ code do?

  • 18-06-2009 12: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, Registered Users 2 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