And actually it is not as thread-safe and resource-leak safe as it is originally claimed. Actually, C++, if properly used can be much safer. This is because you have destructors and STL and destructors that are automatically call when exceptions are thrown. The latter can free memory and resources, the feature that Java completely lacks. If you forget to handle an exception and free all used resources, it is all your fault. In addition, speaking on thread-safety, if a synchronized function A calls another synchronized function B, and under certain circumstances synchronized function B calls function A, you can stuck into a deadlock. This is especially dangerous with newbies, who were fed up with all that stuff on the language being "safe" and doing a lot work for a programmer.
no subject
Date: 2007-05-22 07:40 pm (UTC)In addition, speaking on thread-safety, if a synchronized function A calls another synchronized function B, and under certain circumstances synchronized function B calls function A, you can stuck into a deadlock. This is especially dangerous with newbies, who were fed up with all that stuff on the language being "safe" and doing a lot work for a programmer.