Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Threads :
o multithreading means multiple lines of a single program can be executed at the same time
o the operating system is treating the programs(threads) as two separate and distinct processes
C++ does not contain any built-in support for multithreaded applications. Instead, it relies entirely upon the operating system to provide this feature.
Language-level support for multithreading usually means offering only a “lowest common denominator” of features. With C++, you gain access to all the features that the operating system provides. This is a major advantage when writing high-performance code.
---------- Post added at 11:58 ---------- Previous post was at 11:56 ----------
In Java there are predefined classes for thread programming(Thread class)
---------- Post added at 12:17 ---------- Previous post was at 11:58 ----------
In a thread based multitasking environment , the thread is the smallest unit of dispatchable code. A single program can perform two or more tasks simultaneously(well, almost, for a single processor). Multithreading enables you to write very efficient programs that make maximum use of CPU(low idle time).
Whereas, a function is a block of source code which does one or some tasks with specified purpose and can be called to perform as many time it is needed.
In very simple words this is the difference between function and thread
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.