23.12. Resource Considerations

It is generally stated that creating a large number of mutexes should not be a problem on modern operating systems. However, there are limits and we strongly recommend that node classes do not create a mutex for every instance of the node. It might not appear to be a problem, but someone else might use the node and create a million of them. Using Instance Thread Storage (or Thread Local Storage) is almost always a better solution. In some cases it might be necessary to use a class mutex and accept some performance hit in order to be sure the scene graph can be created.

In any case it is prudent to minimize both the number of mutexes and the number of times they are locked.