English 中文(简体)
先/后 point点原子?
原标题:Pre/Post indecrement of pointers atomic?
  • 时间:2011-07-12 18:07:10
  •  标签:
  • c

在68k岁好的日子里,由于打点人与其他更通用的地址登记册之间的相对一般关系,预先/后点的加点/发价或少保证为原子。 由于这种行为显然是一种68k手工艺品,可能无法在备用平台上取得最有效的实施,因此,我认为C规格没有就这些行动的“分类”提出主张,这是正确的。

最佳回答

假设C类具体化没有就这些行动的“分类”提出主张,这是正确的。

是的。 现行标准(C99和C89,IIRC)没有对原子提出主张。 这无疑是针对具体平台的,可能也取决于汇编者。

Why is it necessary for these operations to be atomic, if I may ask?

问题回答

无论标准是什么具体规定,80x86点算法和“湿”点的转让不是原子的,但点值和派任均在“int”为32比方或大于的所有平台上由原读和原写组成。 点数与星体相同(一些嵌入式平台有16条轨道,但24条轨道点)。 改换标准顺序几乎永远不会成为任何多加工体结构的原子单位,除非我们采取明确措施,使其成为现实。

除非有明确记载,否则永远不会有原子保障。 根据目前的C标准,这意味着no可携带代码能够保证原子——原子操作者必然是针对具体平台的。

正如“@ninjalj”在其评论中指出的那样,C1x将增加原子操作员。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...