@lukasz1985
I don’t agree with most of what you’re saying.
Like you said, “big” problems can always be divided into a number of smaller problems, with part of the problem being how these parts should interact. Minimizing the areas where the problems overlap is the most important thing to do, since a small problem without complex interactions with other problems is a simple problem. Never try to solve a big problem, always divide and conquer.
Locks are not useful for programming. Locks are a way of turning a parallel program into a serial program. For games, the focus is either on increasing performance through parallel computing, or on responsiveness (allowing the UI to continuously update while doing heavy computations in another thread). Therefore locks should be avoided as much as possible. There are almost always lock-less solutions to a problem. Have 4 threads writing to a shared list? Just give each thread its own list. If you for some reason need a single list, then just merge them all into one list when you’re done, preferably while something else is being done on other threads. Bam, no more locking overhead keeping 4 threads busy 75% of the time. From my experience the only time I’ve not been able to get rid of my locks/synchronization is when coordinating which threads should do what. After that’s sorted out you shouldn’t need any synchronization of any kind.
I don’t think most people here think that programming is especially painful. I’m sure some people like the “IT’S FINALLY DONE”-part more than mindless bean making, but the part I enjoy the most is coming up with a fancy algorithm for doing something and then implementing it. It’s the challenge for me.
Avoiding libraries can be a good way to learn new things. For example, using OpenGL directly instead of using an engine built on top of OpenGL will usually be faster since you can do some pretty cool low-level optimizations that can be hard to pull off without a specifically tailored solution to the specific problem. But the same can be said about OpenGL itself. Why use OpenGL when you can interact directly with the GPU? You must know that this is a Java forum, so by simply being here you’re using the Java garbage collectors and built-in libraries. Everyone draws the line somewhere. I think Java has lots of convenient features like garbage collection that lets me focus on what I find interesting instead of bothering with manually freeing pointers. The cost is a garbage collection pause every now and then, but through smart coding that can be kept to a minimum. Plus, I bet that the Java garbage collectors are better at their job than any memory manager I could possibly manage to write myself in C or C++ for example, but I digress. The point is that everyone draws their line somewhere depending on how close to the hardware they want to be. Every level of abstraction costs performance and flexibility, but reduces the time it takes to code and the complexity of the code.
On another hand, I think it’s important to have a deeper understanding about the underlying libraries to be able to code effectively. If you don’t know what the library/hardware you use is doing, you won’t be able to optimize your code well. I guess this is more true for OpenGL than Java, but it can be applied to both. Unless you know how CPU caches work, you won’t understand why LinkedList is so much slower than ArrayList. Unless you know how z-buffering works, you won’t understand why transparency is so hard in 3D. If you don’t know assembler, you won’t know why [icode]i++;[/icode] is not thread safe. I don’t have to code my own Java VM or OpenGL driver to understand how to properly use Java and OpenGL, but I do need to know how they work to some extent.
Your last statement confused me a bit. Why would proper multithreading introduce a delay? The whole point should be to improve performance and/or responsiveness, and both of those should imply a reduced input delay. You’re completely missed the point of multithreading in that case.