Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualJason Goepel

Posted 18 June 2013 - 08:24 AM

The Multithreading page in the documentation states:

 

  • If you plan on creating engines in multiple threads, the application should call asPrepareMultithread from the main thread before the first engine is created, and asUnprepareMultithread after the last engine has been created. This is to avoid race conditions when the engine creates the internal shared thread manager. If only one script engine is used, then it is not necessary to do go through these extra steps.

However, the documentation for the asUnprepareMultithread function states:

 

If asPrepareMultithread() has been called, then this function should be called after the last engine has been released to free the resources prepared for multithreading.

 

 

Which is correct?  Should asUnprepareMultithread be called after the last engine has been created, or after the last engine has been released.  Also, is it important that this function be called from the main thread like asPrepareMultithread?

 

Also, how important is it that asPrepareMultithread be called from the main thread?


#1Jason Goepel

Posted 18 June 2013 - 08:14 AM

The Multithreading page in the documentation states:

 

  • If you plan on creating engines in multiple threads, the application should call asPrepareMultithread from the main thread before the first engine is created, and asUnprepareMultithread after the last engine has been created. This is to avoid race conditions when the engine creates the internal shared thread manager. If only one script engine is used, then it is not necessary to do go through these extra steps.

However, the documentation for the asUnprepareMultithread function states:

 

If asPrepareMultithread() has been called, then this function should be called after the last engine has been released to free the resources prepared for multithreading.

 

 

Which is correct?  Should asUnprepareMultithread be called after the last engine has been created, or after the last engine has been released.  Also, is it important that this function be called from the main thread like asPrepareMultithread?


PARTNERS