This site requires JavaScript, please enable it in your browser!
Greenfoot back
Vise
Vise wrote ...

2019/7/2

Question about the act method and threading.

Vise Vise

2019/7/2

#
Say for example, you have two classes that use the act method. Is it essentially creating two threads (multithreading) to run those act methods or is it all under a single thread? And depending on the answer, is it better in terms of performance for multiple classes to have their own act method or is the performance better to have one class manage all the updates (i.e. only allow your world class to have an act method).
Super_Hippo Super_Hippo

2019/7/2

#
As far as I know, Greenfoot only uses one. Each act cycle, the act method of the active world and the act methods of all actors inside that world are executed one after the other.
You need to login to post a reply.