Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - atomic_read() equivalent api in QNX: (5 Items)
   
atomic_read() equivalent api in QNX  
Hi,

atomic_read() - Is there any equivalent api's available for QNX.

Thanks in advance.

Thanks,
Kabilan
Attachment: HTML sf-attachment-mime23598 1.98 KB
Re: atomic_read() equivalent api in QNX  
You could do:

unsigned val = atomic_add_value(&loc, 0);

On 14-03-14 01:16 AM, Kannan, Kabilan wrote:
>
> Hi,
>
> atomic_read() - Is there any equivalent api's available for QNX.
>
> Thanks in advance.
>
> Thanks,
>
> Kabilan
>

Attachment: HTML sf-attachment-mime23603 2.23 KB
RE: atomic_read() equivalent api in QNX  
De : Gervais Mulongoy [mailto:community-noreply@qnx.com]
Envoyé : 14 mars 2014 09:36
À : ostech-core_os@community.qnx.com
Objet : Re: atomic_read() equivalent api in QNX

You could do:

unsigned val = atomic_add_value(&loc, 0);

Can a read operation be non atomic ?
On 14-03-14 01:16 AM, Kannan, Kabilan wrote:
Hi,

atomic_read() - Is there any equivalent api's available for QNX.

Thanks in advance.

Thanks,
Kabilan

Attachment: HTML sf-attachment-mime23606 3.51 KB
Re: atomic_read() equivalent api in QNX  
I guess if it spanned two cache lines?

On 14-03-14 09:45 AM, Mario Charest wrote:
>
> *De :*Gervais Mulongoy [mailto:community-noreply@qnx.com]
> *Envoy� :* 14 mars 2014 09:36
> *� :* ostech-core_os@community.qnx.com
> *Objet :* Re: atomic_read() equivalent api in QNX
>
> You could do:
>
> unsigned val = atomic_add_value(&loc, 0);
>
> Can a read operation be non atomic ?
>
> On 14-03-14 01:16 AM, Kannan, Kabilan wrote:
>
>     Hi,
>
>     atomic_read() - Is there any equivalent api’s available for QNX.
>
>     Thanks in advance.
>
>     Thanks,
>
>     Kabilan
>

Attachment: HTML sf-attachment-mime23610 4.64 KB
RE: atomic_read() equivalent api in QNX  
Perhaps, If you considered registers and the data cache as separate lines but more likely is the possibility it may take
 more then one instruction.

However, you're correct in that it's unlikely for a read, writes on the other hand are more typical e.g. mov, stm.

-Joel

________________________________________
From: Gervais Mulongoy [community-noreply@qnx.com]
Sent: Friday, March 14, 2014 11:24 AM
To: ostech-core_os@community.qnx.com
Subject: Re: atomic_read() equivalent api in QNX

I guess if it spanned two cache lines?

On 14-03-14 09:45 AM, Mario Charest wrote:
>
> *De :*Gervais Mulongoy [mailto:community-noreply@qnx.com]
> *Envoy� :* 14 mars 2014 09:36
> *� :* ostech-core_os@community.qnx.com
> *Objet :* Re: atomic_read() equivalent api in QNX
>
> You could do:
>
> unsigned val = atomic_add_value(&loc, 0);
>
> Can a read operation be non atomic ?
>
> On 14-03-14 01:16 AM, Kannan, Kabilan wrote:
>
>     Hi,
>
>     atomic_read() - Is there any equivalent api’s available for QNX.
>
>     Thanks in advance.
>
>     Thanks,
>
>     Kabilan
>





_______________________________________________

OSTech
http://community.qnx.com/sf/go/post109433
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com