[reply to] how to atomically update non-atomic data

Dear Hartmut,

I saw your reply only today. Thank you for the answer. As you say this is
not HPX related ...so i cross my fingers that the standard will evolve
favorably. Hopefully on this there is support from the people in the Linux
Kernel team (i learnt recently that a variation of my concern is considered
as a blocker for porting the linux kernel to c11), so it may be given
priority.

regards
Riccardo

On Tue, Sep 27, 2016 at 10:29 PM, Riccardo Rossi <[email protected]>
wrote:

> Dear list,
>
> I have a conceptual trouble with atomics (admittedly principally related
> to c++11),
> however i would be curious on how this issues are solved within HPX.
>
> let's imagine i have a vector
>
> std::vector<double> a(100, 0,0)
>
> which i specifically want to be of "doubles". I DO NOT want to make it
>
> std::vector< std::atomic<double> >
>
> i now wish to update atomically a value of the vector, to do something
> equivalent to
>
> #pragma omp atomic
> a[50] += 1.0
>
> as i understand c++11 does not allow me to do
>
> reinterpret_cast<std::atomic<double> >(a[50]) += 1.0
>
> or as a very minimum the standard does not ensure me that the code will
> work portably.
>
> how could i do this effectively using hpx?
>
> regards
> Riccardo
> --
>
>
> *Riccardo Rossi*
>
> PhD, Civil Engineer
>
>
> member of the Kratos Team: www.cimne.com/kratos
>
> Tenure Track Lecturer at Universitat Politècnica de Catalunya,
> BarcelonaTech (UPC)
>
> Full Research Professor at International Center for Numerical Methods in
> Engineering (CIMNE)
>
>
> C/ Gran Capità, s/n, Campus Nord UPC, Ed. C1, Despatx C9
>
> 08034 – Barcelona – Spain – www.cimne.com  -
>
> T.(+34) 93 401 56 96 skype: *rougered4*
>
>
>
> <http://www.cimne.com/>
>
> <https://www.facebook.com/cimne> <http://blog.cimne.com/>
> <http://vimeo.com/cimne> <http://www.youtube.com/user/CIMNEvideos>
> <http://www.linkedin.com/company/cimne> <https://twitter.com/cimne>
>
> Les dades personals contingudes en aquest missatge són tractades amb la
> finalitat de mantenir el contacte professional entre CIMNE i voste. Podra
> exercir els drets d'accés, rectificació, cancel·lació i oposició,
> dirigint-se a [email protected]. La utilització de la seva adreça de
> correu electronic per part de CIMNE queda subjecte a les disposicions de la
> Llei 34/2002, de Serveis de la Societat de la Informació i el Comerç
> Electronic.
>
>  Imprimiu aquest missatge, només si és estrictament necessari.
> <http://www.cimne.com/>
>



-- 


*Riccardo Rossi*

PhD, Civil Engineer


member of the Kratos Team: www.cimne.com/kratos

Tenure Track Lecturer at Universitat Politècnica de Catalunya,
BarcelonaTech (UPC)

Full Research Professor at International Center for Numerical Methods in
Engineering (CIMNE)


C/ Gran Capità, s/n, Campus Nord UPC, Ed. B0, Despatx 102

(please deliver post to the porters of building C1)

08034 – Barcelona – Spain – www.cimne.com  -

T.(+34) 93 401 56 96 skype: *rougered4*



<http://www.cimne.com/>

<https://www.facebook.com/cimne> <http://blog.cimne.com/>
<http://vimeo.com/cimne> <http://www.youtube.com/user/CIMNEvideos>
<http://www.linkedin.com/company/cimne> <https://twitter.com/cimne>

Les dades personals contingudes en aquest missatge són tractades amb la
finalitat de mantenir el contacte professional entre CIMNE i voste. Podra
exercir els drets d'accés, rectificació, cancel·lació i oposició,
dirigint-se a [email protected]. La utilització de la seva adreça de
correu electronic per part de CIMNE queda subjecte a les disposicions de la
Llei 34/2002, de Serveis de la Societat de la Informació i el Comerç
Electronic.

 Imprimiu aquest missatge, només si és estrictament necessari.
<http://www.cimne.com/>
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to