Menu

#8 YieldCurrentThread for Fortran interface

1.0
open
nobody
None
2015-11-25
2015-11-25
No

Does the C/Fortran interface need a wrapper for OpenThreads YieldCurrentThread? I notice in test2.cpp you are calling this in a loop while checking to see if the window is still running.

I've created an example implementation of the proposed wrapper here.

Discussion

  • Ravi Mathur

    Ravi Mathur - 2015-11-25

    The YieldCurrentThread loop is really only needed if your program does nothing of its own while graphics are being drawn. For real programs, they're always doing something else ... e.g. event polling, simulation processing, etc. This is why I didn't bother adding it to the C/Fortran interface, since Copernicus (or any other sim) always has its own tasks to perform while OpenFrames draws the scene.

    In the demos, event polling is done by OpenFrames itself and the application isn't doing any data processing of its own, which is why YieldCurrentThread is used.

    However, if you think this functionality might just be good to have in general, then I can add it to the C/Fortran interface.

     
  • Jacob Williams

    Jacob Williams - 2015-11-25

    I think it would be nice to have for the simple use case when the application is only an OpenFrames window (similar to the demo). I can see uses for this.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.