[ACCEPTED]-What is a multithreaded application?-multithreading

Accepted answer
Score: 27

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

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

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

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

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

Score: 6

It's an application that can do multiple 7 things at once. For example, if you're 6 tying a document in Word, there's a thread 5 responding to your keyboard, there's a thread 4 that's checking your spelling, there's one 3 that's checking your grammar, there may 2 be another thread saving a backup of your 1 document in case the program crashes.

Score: 2

It's an application that uses more than 7 one thread internally to accomplish its goal.

There 6 are lots of examples, as most application 5 that need to interact with a user have a 4 UI thread and a set of working threads. This 3 is done to allow the UI to remain responsive 2 while the application is busy doing some 1 task.

Score: 2

A multi-threaded application takes advantage 3 of running multiple tasks at the same time 2 to speed things up. Multithreading can also 1 take advantage of multiple CPU machines.

Score: 1

It is a program that uses more than one 18 thread. The different threads can access shared 17 memory structures (usually by using appropriate 16 synchronization mechanisms, e.g. locks). An example would be a program 15 that downloads a few files concurrently, each 14 download using a different thread to speed 13 up the download process (there are more 12 sophisticated ways to achieve that, this 11 is just an example).

Multi-threading is often 10 used on CPU-bound tasks, that benefit from 9 using all cores in a modern computer (e.g. trying 8 to break a cypher using multiple processors).

The 7 difference between a thread and a process 6 is that different processes usually cannot 5 directly share memory and data structures, although 4 various mechanisms to share information 3 between processes exist (they are usually 2 more costly than sharing information between 1 threads).

Score: 1

Multithreading is a mechanism of programing 6 that you can implement in order to gain 5 a remarkable time.

so a Multithreading application 4 is an application that uses more than two 3 threads for two processor or more and it 2 doesn't make sense to have more threads 1 than processor it should be the same.

Score: 1

Multithreaded applications are the ones 8 which uses concept of Concurrency i.e. they 7 are capable of processing more than one 6 tasks in parallel.

A simple example could 5 be a word-document in which , spell-check, response 4 to keyboard, formatting etc happens at the 3 same time or Concurrently. Internally there 2 are different threads which are doing these 1 task independently.

Source : https://docs.oracle.com/javase/tutorial/essential/concurrency/

Score: 0

what he said

The implementation of threads 6 and processes differs from one operating 5 system to another, but in most cases, a 4 thread is contained inside a process. Multiple 3 threads can exist within the same process 2 and share resources such as memory, while 1 different processes do not share these resources.

More Related questions