Sponsored Content
Full Discussion: Atomicity
Top Forums Programming Atomicity Post 50906 by S.P.Prasad on Wednesday 5th of May 2004 09:37:22 AM
Old 05-05-2004
As I am not confident about a topic and it may sound to be silly, so forgive me for my query.

My question is 'is if atomic' i.e. suppose if I have the following lines of code in a 'C' program:

......;
......;
x=0;
y=8;
u=1;
z=9;
...... ;
.......;

if ( x == 0 && y ==8 && ++u || z = user_func ( ) && ...... )
{
/* Statements to be executed */
}
..........;
..........;

Does atomicity regarding 'if' is implied in 'C'.

Thanks in advance.

Last edited by S.P.Prasad; 05-05-2004 at 10:42 AM..
 
std::atomic< _Tp >(3cxx)												  std::atomic< _Tp >(3cxx)

NAME
std::atomic< _Tp > - SYNOPSIS
Public Member Functions atomic (const atomic &) constexpr atomic (_Tp __i) bool compare_exchange_strong (_Tp &, _Tp, memory_order, memory_order) bool compare_exchange_strong (_Tp &, _Tp, memory_order, memory_order) volatile bool compare_exchange_strong (_Tp &, _Tp, memory_order=memory_order_seq_cst) bool compare_exchange_strong (_Tp &, _Tp, memory_order=memory_order_seq_cst) volatile bool compare_exchange_weak (_Tp &, _Tp, memory_order, memory_order) bool compare_exchange_weak (_Tp &, _Tp, memory_order, memory_order) volatile bool compare_exchange_weak (_Tp &, _Tp, memory_order=memory_order_seq_cst) bool compare_exchange_weak (_Tp &, _Tp, memory_order=memory_order_seq_cst) volatile _Tp exchange (_Tp __i, memory_order=memory_order_seq_cst) _Tp exchange (_Tp __i, memory_order=memory_order_seq_cst) volatile bool is_lock_free () const bool is_lock_free () const volatile _Tp load (memory_order=memory_order_seq_cst) const _Tp load (memory_order=memory_order_seq_cst) const volatile operator _Tp () const operator _Tp () const volatile atomic & operator= (const atomic &) atomic & operator= (const atomic &) volatile _Tp operator= (_Tp __i) _Tp operator= (_Tp __i) volatile void store (_Tp, memory_order=memory_order_seq_cst) void store (_Tp, memory_order=memory_order_seq_cst) volatile Detailed Description template<typename _Tp>struct std::atomic< _Tp > atomic 29.4.3, Generic atomic type, primary class template. Definition at line 155 of file atomic. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Nov 27 2012 std::atomic< _Tp >(3cxx)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy