Being a well designed thread, it locks that data in place while it is reading it, and then locks it again when it is writing the calculated value back
No, no, no!!! This is INCORRECT!
It is necessary to lock data during reads/writes
ONLY in the circumstance that some other thread has the oppertunity to change the value you are currently using at the same time. If no other thread has the oppertunity to read/write that data, there is no need to waste CPU resources putting a lock on it.
BSOD in Windows? Probably a thread that got out of hand.
More like memory corruption, which has nothing to do with thread management.
To add to this, when thread A is done with it's work, it's got all kinds of loose end laying all around, ready to trip up any other thread that has to work in the same space.
Nope. In Windows, every piece of data a process uses exists within the same Virtual Memory space [2GB for Win32, up to 192GB (software limit) in Win64]. What one thread does to some piece of data will have no impact on the rest of hte process unless:
A: You run out of Virtual Memory [and thus need to clean up some space]
B: Another thread tries to use it
ahem, C...you have to be very much on your game when mutli-threading in C
Technically, C only supports p-threads, which are designed for cooroporative multithreading, which is no longer supported by any major OS. All threading is typically done using the OS [Windows] API, and not the language itself. [Though the latest C/C++ revisions are finally adding proper multi-threading support...]
I've written programs in C (not even C++) that manage dozens (40+) threads without any issues. Its not that hard, assuming your program design is correct. [I find most problems with threading is the programmer trying to apply threading incorrectly]
Single-core programming means thinking in terms of programs. They start, they run, then end.
Wrong. For my college seminar project, I wrote a program that scaled dynamically to 40 or so threads. This was back in the late 90's, running happily on a 1.2GHz Pentium III.
A thread is the basis of execution in windows. Regardless of single/multiple cores,
within Windows, the thread with the highest priority always runs. When you adjust priority of a process in task manager, all you do is increment the priority of that process' threads, nothing more.
A good reason to thread on a single core system is to prevent the user input from locking up during a long operation. For example, your encoding a video and decide you want to stop, so you hit the "cancel" button. If you didn't make the actual encoding operation [which continues until done or an error detected] seperate from the GUI, the mouse click on cancel event would never get parsed, and the user input would not do anything. [As a general rule, if writing a GUI application that does any significant work, make the default thread that starts up the GUI thread, and make new threads for any other work not involving the GUI].