Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

asUnprepareMultithread


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Jason Goepel   Members   -  Reputation: 418

Like
0Likes
Like

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?

 

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


Edited by Jason Goepel, 18 June 2013 - 08:24 AM.


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3366

Like
1Likes
Like

Posted 18 June 2013 - 10:34 AM

The latter description is the correct one. asUnprepareMultithread should be called after the last engine has been released.

 

It is not absolutely necessary that the calls are made from the main thread, but it is easier to guarantee the correct order of execution if it is done that way.

 

I'll update the manual to correct this. Thanks for bringing it to my attention.

 

Regards,

Andreas


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS