i'm building a bank management system and cant seem to figure out how to make it possible for users to deposit money to their accounts. I basically have one file that holds all of my accounts (database.dat) which has all the values associated with each account stored in an array of structs (key, account number, name, and account balance) . what i've been trying to do is read from that file, look for a match between the key pin provided by the user and the account.key (struct value) and if they match, rewrite that specific struct with an updated account balance to a temp file as well as all other account structs, then rewrite all of them back to the main file with the updated account and account balance. Does this logic make sense?
#i'm building a bank management system and cant seem to figure out how to make it possible for users
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
My concern is actually with the atomicity of transactions (read -> update -> write)
Also the RCU
In computer science, read-copy-update (RCU) is a synchronization mechanism that avoids the use of lock primitives while multiple threads concurrently read and update elements that are linked through pointers and that belong to shared data structures (e.g., linked lists, trees, hash tables).Whenever a thread is inserting or deleting elements of d...
Anyways, the question is not C-specific 😁
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.