views:

91

answers:

1

How do I utilize fibers best in my game code? Should it only be used to manage nonpreemptive context-switches while loading resources (i.e. files from disk)? Or do I allow all types of game entities to run in a fiber? How do I schedule?

C++ or pseudo code samples greatly appreciated!

+2  A: 

Don't? It's like a thread only with very little CRT support (unlike threads) and some hidden memory requirements like stack and registers.

It may make non-system code easier to write but it complicates to an unjustifiable degree.

MSN
Fibers are notoriously subtle, and I've never heard of a major piece of production software that used them extensively and successfully (though I've heard of plenty that tried, then quit.)
Greg D
You never heard of Stackless Python (http://stackless.com) or Eve Online (http://eveonline.com)?
Jonas Byström