- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm developping a very fine-grained parallel application. To synchronize my threads which performs the same computation, I use spin-loops using the following style "while(value!=1) {};" to minimize the execution time.
I see that SSE3 provides the _mm_monitor/_mm_mwait intrinsics.
Are these intrinsics available at the user space (not ring 0)?
But I didn't find any example on how I can use these statements.
Does someone have a small example?
Does someone have some benchmarks about these intrinsics ?
The documentation says "CPUID allows for the determination of the exact length of the triggering area".
In which field can I find this size ?
Mickal
Hello,I'm developping a very fine-grained parallel application. To synchronize my threads which performs the same computation, I use spin-loops using the following style "while(value!=1) {};" to minimize the execution time.I see that SSE3 provides the _mm_monitor/_mm_mwait intrinsics.Are these intrinsics available at the user space (not ring 0)?But I didn't find any example on how I can use these statements.Does someone have a small example?Does someone have some benchmarks about these intrinsics ?The documentation says "CPUID allows for the determination of the exact length of the triggering area".In which field can I find this size ?Mickal
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mickal,
Which complier are you using? It might be best for us to move your question to the appropriate compiler forum, to see if our technical consulting engineers can answer it.
Best regards,
==
Aubrey W.
Intel Software Network Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
I use the intel compiler c++ 11.1. Yes, you can move it to the correct forum.
Best regards,
Mickal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check this article - http://software.intel.com/en-us/articles/use-the-monitor-and-mwait-streaming-simd-extensions-3-instructions/to see if it provides you enough info.
The reference link at the bottom points you to the comprehensive doc.
Jennifer
The reference link at the bottom points you to the comprehensive doc.
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This documentation is clear but it does not specify if that instruction is available at user ring level.
Clear explanations are available in the section "Checking for SSE3 Support" of the manual "IA-32 Intel Architecture Software Developers Manual Volume 1 Basic Architecture".
Does linux support this type of instruction at the user application level ?
Does someone perform a benchmark of this instructions against spin-loop, such as "while (*address!=1) {}" ?
I want to use these instructions to synchronize threads in a N-body problem with N is very small.
Mickal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, is there someone that used these instructions? With a simple test it gives me "Illegal Instruction".
[cpp]int a=0, int b=0; if (!c.flags) { _mm_monitor(&c.flags, a, b); _mm_mwait(a, b); }[/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting praz
Well, is there someone that used these instructions? With a simple test it gives me "Illegal Instruction"...
You need to verify ifMONITOR and MWAIT instructions aresupported on your CPU and if they could be executed
at a privilege level 3. Please take a look at IntelInstruction Set Reference volume 2A ( A-M ). A CPUID instriction
has to be used for verifications.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't haveantiques, so yes, it's supported. I've found the info inIntelInstruction Set Referencevolume 2B:
"MONITOR may be executed only at privilege level 0 (use atany other privilege level results in an invalid-opcode exception)."
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