Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
643 views

I've read the Core Data references on Apple's site. But I wonder, what they mean with atomic store types? They write something of "they have to be read and written in their entirety". Could somebody ...
Stefan's user avatar
  • 29k
1 vote
3 answers
3k views

I have a simple django app to simulate a stock market, users come in and buy/sell. When they choose to trade, the market price is read, and based on the buy/sell order the market price is increased/...
user avatar
26 votes
6 answers
7k views

Reads and writes to certain primitive types in C# such as bool and int are atomic. (See section 5.5, "5.5 Atomicity of variable references", in the C# Language Spec.) But what about accessing such ...
dan-gph's user avatar
  • 17.1k
0 votes
1 answer
778 views

Is there any way to make microsoft access transactions atomic across multiple users? I have found this which seems to imply that they are not, but I am wondering if atomicity in access is driver ...
Aran Mulholland's user avatar
0 votes
4 answers
361 views

I'm wondering what is the "best" way to make data thread-safe. Specifically, I need to protect a linked-list across multiple threads -- one thread might try to read from it while another thread adds/...
beepboopbopbop's user avatar
13 votes
2 answers
23k views

I'm implementing a lock-free mechanism using atomic (double) compare and swap instructions e.g. cmpxchg16b I'm currently writing this in assembly and then linking it in. However, I wondered if there ...
bugmenot77's user avatar
10 votes
1 answer
3k views

I am aware of GCC's builtin atomic operations: http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Atomic-Builtins.html But this list doesn't include very simple operations like load and store. I could ...
Greg Rogers's user avatar
  • 36.6k
6 votes
4 answers
660 views

I'm running into a situation where I need the atomic sum of two values in memory. The code I inherited goes like this: int a = *MemoryLocationOne; memory_fence(); int b = *MemoryLocationTwo; return (...
Dan Olson's user avatar
  • 23.5k
2 votes
2 answers
6k views

Regarding Update and Insert triggers for MS SQL Server, is there a way to make them atomic? In other words, if an error occurs during the trigger, is it possible to automatically roll back the ...
recursive's user avatar
  • 86.5k
1 vote
3 answers
1k views

I need to get 1000 rows from a database, and at the same time tag them as 'in process'. This way, another thread can not take the same 1000 rows and process them as well. With linq i do something ...
Toad's user avatar
  • 16k
1954 votes
28 answers
541k views

What do atomic and nonatomic mean in property declarations? @property(nonatomic, retain) UITextField *userName; @property(atomic, retain) UITextField *userName; @property(retain) UITextField *...
Alex Wayne's user avatar
  • 188k
2 votes
8 answers
2k views

I recently refactored a piece of code used to generate unique negative numbers. edit: Multiple threads obtain these ids and add as keys to a DB; numbers need to be negative to be easily identifiable -...
jorgetown's user avatar
  • 455
3 votes
6 answers
1k views

I have a set of files. The set of files is read-only off a NTFS share, thus can have many readers. Each file is updated occasionally by one writer that has write access. How do I ensure that: If the ...
Pyrolistical's user avatar
  • 28.1k
8 votes
3 answers
2k views

I have a very common situation. I have a file, and I need to entirely overwrite that file with new contents. However, the original file is accessed on every page load (this is a web app), so it can't ...
Max Kanat-Alexander's user avatar
0 votes
4 answers
2k views

I'd like to use POSIX semaphores to manage atomic get and put from a file representing a queue. I want the flexibility of having something named in the filesystem, so that completely unrelated ...
Norman Ramsey's user avatar
85 votes
10 answers
56k views

If there a way to protect against concurrent modifications of the same data base entry by two or more users? It would be acceptable to show an error message to the user performing the second commit/...
Ber's user avatar
  • 42k
1 vote
4 answers
1k views

I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the CPU utilization by a given Win32 thread. For the sake of accuracy, I need to ensure that both GetSystemTime() ...
sachinjm's user avatar
  • 105
15 votes
8 answers
8k views

Edit: The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for the record I took the problem over to the Intel discussion ...
13 votes
7 answers
9k views

I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives... E.g., WIN32 on x86 has a family of functions ...
15 votes
7 answers
14k views

In a C++ Linux app, what is the simplest way to get the functionality that the Interlocked functions on Win32 provide? Specifically, a lightweight way to atomically increment or add 32 or 64 bit ...
twk's user avatar
  • 17.4k
21 votes
7 answers
19k views

How do you implement an efficient and thread safe reference counting system on X86 CPUs in the C++ programming language? I always run into the problem that the critical operations not atomic, and ...
Fabian's user avatar
  • 1,844
98 votes
16 answers
44k views

I have two threads, one updating an int and one reading it. This is a statistic value where the order of the reads and writes is irrelevant. My question is, do I need to synchronize access to this ...
theschmitzer's user avatar

1
77 78 79 80
81