Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • That's hardly the only difference - they are different sizes and reading/writing int values is atomic, while they aren't for nullable ints. Commented Jul 3, 2013 at 20:29
  • @Lee For your first one: we're not using pointers. Second one: Sure is, unless you're using the value again, which is what most people do. Commented Jul 3, 2013 at 20:30
  • I don't see what pointers have to do with anything, and for the second point, reading/writing nullable ints is not atomic, so multiple threads updating an int? field could see torn reads and writes. See this question for example. Commented Jul 3, 2013 at 21:10
  • @lee Why else would you need the size? Also, I know. However, when you're using ints most changes are something like x = someOperations + x and so on. And if you aren't using Interlocked there then you have a problem. Commented Jul 3, 2013 at 21:11