- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Anyone knows if a module variable with private attribute can be assigned to threadprivate in OMP? I tried this, define several such module variables as threadprivate, the compiler seems to be OK with this but the program crashes for no reason.
Link kopiert
2 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The PRIVATE attribute would have no effect on OpenMP - all it does is control the visibility of the name to program units that USE the module.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
A "static" variable/array/user defined typein a module can be thread private
A member variable within a user defined type cannot be thread private without the encapsulating user defined type being itself thread private. If this is not your circumstance, then you have a coding error. The usual errors relating to this is failure to initialize data that ought to have been initialized. I suggest you insert some conditional compiled asserts into your code to assure that what you assume to be true is in fact true.
Jim Dempsey
A member variable within a user defined type cannot be thread private without the encapsulating user defined type being itself thread private. If this is not your circumstance, then you have a coding error. The usual errors relating to this is failure to initialize data that ought to have been initialized. I suggest you insert some conditional compiled asserts into your code to assure that what you assume to be true is in fact true.
Jim Dempsey

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite