11/25/2023 0 Comments Qt signals slots threads example![]() In order to switch between processes, the current program counter is saved and the next processor's program counter is loaded. Then the processor moves on to the next process. For processes, the illusion is produced by interrupting the processor's work on one process after a very short time. So how is concurrency implemented? Parallel work on single core CPUs is an illusion which is somewhat similar to the illusion of moving images in cinema. ![]() This is what threads are for - concurrency within one single process. While the media player is sending music to the audio driver, the user interface with all its bells and whistles is being constantly updated. A closer look at the media player reveals that there are again things going on in parallel within one single process. Multitasking is a well known term for this. Here is an example of two processes working in parallel: one running the spreadsheet program one running a media player. So how do threads differ from processes? While you are making calculations on a spreadsheet, there may also be a media player running on the same desktop playing your favorite song. ![]() Threads are about doing things in parallel, just like processes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |