What is a multithreaded application?

I am looking to learn more about threading and I wanted to know: what is a multithreaded application?

54.4k 15 15 gold badges 134 134 silver badges 224 224 bronze badges asked Aug 21, 2009 at 16:52 2,015 10 10 gold badges 36 36 silver badges 57 57 bronze badges

9 Answers 9

Multithreading as a widespread programming and execution model allows multiple threads to exist within the context of a single process. These threads share the process' resources but are able to execute independently. The threaded programming model provides developers with a useful abstraction of concurrent execution. However, perhaps the most interesting application of the technology is when it is applied to a single process to enable parallel execution on a multiprocessor system.

That means that a single process can have many different "functions" executing concurrently, allowing the application to better use the available hardware (multiple cores/processors). Threads can communicate between them (they have shared memory), but its a hard problem to have every thread behave well with others when accesing shared objects/memory.

Threading allows an application to remain responsive, without the use of a catch all application loop, when doing lengthy operations.

For example, a non threaded copy program wouldn't allow you to do anything until the copy completes.

Threading helps with complex, lenghty, independent problems, but brings along a lot more complexity, that makes it hard even for seasoned developers.