News for hackers. Stuff that matters.
Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by k__ on Friday May 27, 2016 @05:58AM (#11784936)
Cool.

Me and a friend did this at university with the Ogre 3D engine and failed miserably, because I didn't know much abut C++ or thread safety.

We tried the actor model, every game object became an actor and sent messages around. The actors would then be spread over the amount of CPUs and the performance should rise with every CPU. In the end we got it running on multiple cores, but the message overhead killed the performance, haha.

Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by wolfgke on Friday May 27, 2016 @06:49AM (#11785106)
> Me and a friend did this at university with the Ogre 3D engine and failed miserably, because I didn't know much abut C++ or thread safety.

Fiber safety is much more easy to assure than thread-safety. Under Windows using fibers is very simple (just use ConvertThreadToFiber on your current thread if you have not done already and then call CreateFiber) in opposite to POSIX systems where you will have to roll up your own implementation of fibers (or use some existing library which is not part of the POSIX standard).

Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by gpderetta on Friday May 27, 2016 @07:06AM (#11785173)
makecontext/swapcontext was the POSIX approved way to do fibers. It was removed from the last POSIX standard because who uses coroutines or fibers today? Around the same time every other mainstream language was adding support for corutines/generators/fibers.
Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by wolfgke on Friday May 27, 2016 @09:08AM (#11785727)
makecontext/swapcontex doesn't have automatically growing stack (opposed to their WinAPI equivalents). Yes, you can do this, too, I know. But if you don't want to go into the gory details here you either have a alloc a "large enough" buffer for your coroutines thus probably wasting memory.
Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by gpderetta on Friday May 27, 2016 @10:00AM (#11786061)
technically you only waste address space which should be plenty enough at least for a while.