97: Multithreading. The Big Event.
There is more to working with multithreading than locking code and avoiding deadlocks. You also need to know how to synchronize activities. It is not so hard once you understand.

There is more to working with multithreading than locking code and avoiding deadlocks. You also need to know how to synchronize activities. It is not so hard once you understand.
The design decisions you make affect not only how well you can maintain your code but also how well others can use your code. Multithreading adds a new dimension to your designs and I will give you some of my thoughts in this episode.
Deadlocks are another common problem with multithreading. I will explain how you can get into this situation and how to change your code to avoid the problem.
What makes a good personal programming side project?
Anytime a thread tries to access some memory or resource that another thread can change, you have a race condition. There is no winner for this kind of race. The whole application will lose.
Do you know when to use multithreading? What are the advantages and disadvantages?
There are several ways to make better use of the capabilities of your computer. Multiple threads allow your application to perform multiple things at the same time. With this power comes a lot of responsibility and you should also realize that it is not the answer to everything.
Whenever your application has several things to do, you need to figure out how to schedule those things. This episode explains a common technique called a round robin that gives everything a fair share.
After working 8 hours, how can I learn to program in the evening?
The object pool behavioral pattern allows you to reuse objects instead of destroying them and creating them again.
The dirty flag behavioral pattern allows you to avoid expensive operations that would just need to be done again anyway.
The service locator behavioral pattern allows you to make use of an interface without knowing what class implements the interface.
The event queue behavioral pattern allows you to keep track of work that needs to be done and let some other code actually perform the task.
Can I learn programming if I am stupid?
The component behavioral pattern allows you to add just the features to your objects that are needed and keep the features independent of each other.
The subclass method behavioral pattern allows many different subclasses to define their own behavior while reusing common functionality from the base class.
The update method behavioral pattern works with the previous game loop pattern and lets you manage the behavior of multiple game characters.
The game loop behavioral pattern is essential in games and simulations to make the actions proceed at the proper speed regardless of what the user is doing or how fast the computer is.
How do you make a design easy to understand?
The double buffer behavioral pattern allows multiple changes to all appear to occur at the same time.
The visitor behavioral pattern allows you to perform actions on a collection of different types where the actions depend on the types.
The template behavioral pattern allows your derived classes to change certain aspects of the base class behavior without needing to rewrite everything.
The strategy behavioral pattern allows you to define multiple ways to perform some action and then select the best approach.
What is identity?
The state behavioral pattern allows you to simplify your code when you have different modes of operation.
The observer behavioral pattern allows you to be notified of any changes instead of constantly checking.
The memento behavioral pattern allows you to save and later restore the state of an object even without full access to all properties.
The mediator behavioral pattern allows you to define complex object interactions while still keeping each object simple and unaware of the other objects.
How much programming do you need to know before you can call yourself a programmer?
The iterator behavioral pattern allows you to access objects in a collection or anything that contains multiple items without worrying about how this is done.