correct way to yield or give time to main thread in parallel_for? RRS feed

  • Question

  • I have a few parallel_for loops which are very useful as we have 3 dimensional arrays that can be accessed and acted on safely (read / writes are independent locations)

    I would like to be able to call out to the main thread to update an indeterminate progress bar. In this app, it happens to be a Qt progress bar, but it shouldn't matter. I just want to update the UI.

    I've seen concurrent::event, and it seems like this might be one way but I'm unclear as to how to use it for this.



    Thursday, March 10, 2016 9:37 PM

All replies

  • hmm, wrong forum, I guess. Sounds like C++.
    Thursday, March 10, 2016 10:14 PM
  • Hi, Rick Frank

    According to your description, please correct me if I have any misunderstandings on your question, as far as I know that VBA is built in a single-threaded apartment. The only way to get multiple threads is to build a DLL in something other than VBA that has a COM interface and call it from VBA.

    INFO: Descriptions and Workings of OLE Threading Models

    In addition could you provide more information about your issue, for example sample code, screeshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    Friday, March 11, 2016 3:07 AM
  • hmm, where do you see parallel_for and Qt in VBA?
    Friday, March 11, 2016 9:30 AM
  • Hi, Stefan Hoffmann

    Thanks for you correct me. I will be more careful.

    Monday, March 14, 2016 9:23 AM
  • Hi, Rick Frank

    This is the forum to discuss questions and feedback for Access for Developers, so I suggest that you could post your question on forum for Visual C++

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. 

    Thanks for your understanding.

    Wednesday, March 16, 2016 9:14 AM