Suggestions for semaphore and mutex examples for the tutorials

Started by
1 comment, last by flashingchicken 17 years, 10 months ago
I'm trying to think of a simple example program for my tutorials. I'm stuck because I can't think of an example program that wouldn't involve video functions in seperate threads. So far I came up with this: For the semaphore tutorial I though of having the blitting function being protected with a binary semaphore and have two threads blitting a set of images on the screen. For the mutex/conditions tutorial I was thinking doing a classic producer/consumer dealie. On one side the producer shows its randomly produced set of images and on the other the consumer shows it's copy of the images. Yeah so any ideas you guys throw at me would be appreciated.

Learn to make games with my SDL 2 Tutorials

Advertisement
How about a ship that has different functions which run separately from each other: such as shields, guns, reload of guns, regeneration of shields, power output.

or something similar....?

Beginner in Game Development?  Read here. And read here.

 

for one program, i used a seperate thread to continually do force equations (physics) and a semaphore to denote it being updated.

This topic is closed to new replies.

Advertisement