News for hackers. Stuff that matters.
Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by frik on Thursday April 02, 2015 @01:37PM (#9312120)
Fibers is a kind of lightweight thread, also known as coroutine.

It's available in WinAPI since Win16 days and heavily used in MS Word. It's also heavily used in many AAA games that use Lua 5.1/LuaJIT, known as coroutine. And in the Go language its named Goroutine.

http://en.wikipedia.org/wiki/Fiber_(computer_science) , Lua Coroutines http://www.lua.org/pil/9.html , Lua in video games http://en.wikipedia.org/wiki/Category:Lua-scripted_video_gam..., Go Goroutines http://www.golang-book.com/10/index.htm

Triva: Naughty Dog uses a Lisp/Scheme dialect for their scripting language: http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp, http://www.quora.com/Does-Naughty-Dog-still-use-lisp-for-mak...

Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by beering on Thursday April 02, 2015 @04:06PM (#9312850)
The different types of lightweight threads and thread-like things can differ quite a bit in their implementation and usage.

E.g. some are explicitly cooperative and require the function to Yield() to other coroutines. Others, like goroutines (which are more like threads) automatically yield at certain points (e.g. I/O or function calls).

I think generally coroutines imply that the programmer handles more of the logic of when to switch tasks, while lightweight threads (in Go, Haskell, etc.) imply that there's more stuff "behind the scenes" to manage the concurrency for you like real OS threads. You may have lightweight threads that are multiplexed onto multiple OS threads, but you wouldn't have coroutines that are multiplexed onto multiple OS threads because coroutines implies no parallelism.

Re:Parallelizing the Naughty Dog Engine Using Fibers [video] by jeremiep on Thursday April 02, 2015 @04:30PM (#9313010)
Naughty Dog switched to PLT Scheme during the Uncharted series, which is documented here:

http://www.slideshare.net/naughty_dog/statebased-scripting-i...