- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Theoritically i understood two or 'N' threads are run parrallely. but in embeeded system how it would be. however threads should share the cpu time by means of some algorithms like roundrobin,FIFO,Shortest jobfirst,preemptive.so seems like noparallelism. if one thread finishes the allocated cpu time another thread will execute then where is the concurrent concepts arises.
similarly threads are nothing but a task,if a thread executes it will be in RUN state. another recently arrived thread would be in ready state, if a thread present in RUN state finishes it work,whatever task present in the ready state now pushed in to running state so it will execute. so no threads are run parrally?
Pls clear my doubts.
Regards
Muthazhagan
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Processor is generally described as a package (with pins on the bottom)
A Processor may contain one or more dies (silicon chips affixed into the processor package)
Each die may contain one or more Cores (e.g. Dual Core Processors)
Each Core may contain one or more hardware threads.
Each hardware thread "looks like" a dedicated processor.
An embedded system can be as restrictive as:
1 processor package with
1 die with
1 core, eachwith
1 hardware thread
In the above, you historicallywould call it "a processor"
Consider an embedded system with an Intel Atom Dual-Core processor wiht HyperThreading
1 processor package with
1 die with
2Cores, each with
2 hardware threads
In the above, you have one processor that looks like 4 processors (also called 4 logical processors)
A single logical processor, single die, single core, single thread system can still support multiple threads in a time-sliced manner(what you describe). But this technique is being replaced by a more capable processor (more hardware threads).
Jim Dempsey
A Processor may contain one or more dies (silicon chips affixed into the processor package)
Each die may contain one or more Cores (e.g. Dual Core Processors)
Each Core may contain one or more hardware threads.
Each hardware thread "looks like" a dedicated processor.
An embedded system can be as restrictive as:
1 processor package with
1 die with
1 core, eachwith
1 hardware thread
In the above, you historicallywould call it "a processor"
Consider an embedded system with an Intel Atom Dual-Core processor wiht HyperThreading
1 processor package with
1 die with
2Cores, each with
2 hardware threads
In the above, you have one processor that looks like 4 processors (also called 4 logical processors)
A single logical processor, single die, single core, single thread system can still support multiple threads in a time-sliced manner(what you describe). But this technique is being replaced by a more capable processor (more hardware threads).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be this lik will be of some help to you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible create one block of code, that create two thread and each thread run on each core of the processor?
Att.
Maycon
Att.
Maycon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure
In C/C++ using OpenMP
#pragma omp parallel for
for(int i=0; i < n; ++i)
{
// each thread enters here with different subset of iteration space
}
Or
#pragma omp parallel
{
// all threads enter here
}
You should read documentation on OpenMP as there are programming issues and means to resolve these issues. The principal among these are data sharing issues. Look at SHARED(...) and PRIVATE(...) clauses for OpenMP statements.
Jim Dempsey
In C/C++ using OpenMP
#pragma omp parallel for
for(int i=0; i < n; ++i)
{
// each thread enters here with different subset of iteration space
}
Or
#pragma omp parallel
{
// all threads enter here
}
You should read documentation on OpenMP as there are programming issues and means to resolve these issues. The principal among these are data sharing issues. Look at SHARED(...) and PRIVATE(...) clauses for OpenMP statements.
Jim Dempsey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page