locked
using concurrency::Wait in unit test method RRS feed

  • Question

  • Hi,

    What will happen if i use concurrency::Wait(5) in a unit test method ? Will this wait be indefinite ? is it possible for the test to resume back ?

    Thanks !!

    Sunday, June 22, 2014 6:17 PM

Answers

  • @Minu7,

    Glad to see you again!

    About “concurrency::Wait()” issue, the real issue is that how to use it in VC++, so it is not the unit test issue, I mean that it would be related to the VC++ language development.

    Like this MSDN document:

    http://msdn.microsoft.com/en-us/library/dd470689.aspx

    We know that it is used to pauses the current context for a specified amount of time, the number of milliseconds the current context should be paused for. If the _Milliseconds parameter is set to the value 0, the current context should yield execution to other runnable contexts before continuing.

    >>Will this wait be indefinite? Is it possible for the test to resume back?

    As my understanding, nothing is impossible, it would be related to your runnable contexts. For example, like the context in above link, if the scheduler is busy executing other tasks that do not cooperatively yield to the scheduler, the wait period could be indefinite.

    If you really want to know more about it, I suggest you post an issue in the VC++ forum here:

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 24, 2014 10:11 AM