race-condition Questions
7
Solved
My WordPress plugin has a table with a AUTO_INCREMENT primary key field called ID. When a new row is inserted into the table, I'd like to get the ID value of the insertion.
The feature is to usin...
Cosmopolis asked 16/10, 2009 at 1:27
0
I've created a binary semaphore that can be shared between two processes using pthread_mutex_t, pthread_cond_t and bool flag. But I've a little doubt of my implementation regarding the initializati...
Keepsake asked 17/10, 2021 at 14:22
3
Solved
I've heard about many application developers having a bit of trouble in regards to race conditions in database processing. A typical example goes something like this:
User 1 selects a field, say,...
Diaconicum asked 24/3, 2012 at 8:46
1
Solved
Does a SELECT query following an INSERT … ON CONFLICT DO NOTHING statement always find a row, given the default transaction isolation (read committed)?
I want to INSERT-or-SELECT a row in one table...
Devy asked 4/9, 2021 at 2:30
3
Solved
In my application I need some data to be loaded inside the VueX store before routing starts (for example user sessions).
An example of a race condition would be the following:
// In routes defini...
Harve asked 24/7, 2018 at 9:45
3
When I run the following code, the final output is always positive, and if I switch the order of the "x++" and the "x--" then the final output is always negative. Is there some ...
Pointdevice asked 14/4, 2021 at 15:15
2
Solved
Might sound a little silly but I'm not proficient in Java so wanted to make sure:
If there are two code points
I:
if (_myVar == null)
{
return;
}
II:
synchronized (_myLock)
{
_myVar = MyVarFa...
Lovemaking asked 31/3, 2021 at 22:24
3
Solved
I'm fairly new to Laravel and am currently using an API that has a limit of 25 requests per minute.
I have a controller method sendRequest() which is used by all methods to send requests to the API...
Echeverria asked 29/6, 2020 at 15:50
2
Solved
I am working fixing on some coverity issues and i am confused about how to solve toctou for stat a directory and make a directory.
////////////////////////////////////
// Make sure storage dir exis...
Jampan asked 4/3, 2021 at 20:25
2
I'm coding my Google Chrome Extension where I set the app's icon from the background script as such:
try
{
objIcon = {
"19": "images/icon19.png",
"38": "images/icon38.png"
};
chrome.browserA...
Bartz asked 9/9, 2014 at 0:29
2
Solved
There is a somewhat famous Unix brain-teaser: Write an if expression to make the following program print Hello, world! on the screen. The expr in if must be a legal C expression and should not cont...
Ascidian asked 14/1, 2021 at 7:4
1
In my Electron application, I am seeing weird behavior. In Windows, sometimes the renderer process executes before the initialization of Electron finishes, which is causing the issue in a startup.
...
Zayin asked 12/12, 2020 at 22:3
6
Solved
My question refers specifically to why it was designed that way, due to the unnecessary performance implication.
When thread T1 has this code:
cv.acquire()
cv.wait()
cv.release()
and thread T2 ...
Following asked 6/9, 2017 at 13:9
1
I'm creating a custom logger where we can log to std out and std err, but also adding the possibility to log to kafka (the code example is here: https://github.com/roppa/kafka-go). We have multiple...
Euthenics asked 9/12, 2020 at 15:40
5
Solved
Suppose I load some Flash movie that I know at some point in the future will call window.flashReady and will set window.flashReadyTriggered = true.
Now I have a block of code that I want to have e...
Manard asked 30/8, 2011 at 4:11
5
Solved
What is the difference between a dead lock and a race around condition in programming terms?
Apocalyptic asked 28/6, 2010 at 4:37
0
What could be possible alternative solution to implement Idempotency and also handle race condition.
For ex. consider a request to add a customer to System Of Record. The customer detail will have ...
Ciprian asked 28/7, 2020 at 11:55
1
My question is about nodejs event loop
Consider this code
(async () => {
let val = 1
const promise = new Promise(async resolve => {
resolve()
await new Promise(async r => {
setTimeout...
Inquisitive asked 6/5, 2020 at 4:30
4
Solved
Please let me begin with that I know it is a bad practice to call virtual functions from within a constructor/destructor.
However, the behavior in doing so, although it might be confusing or not wh...
Pharyngoscope asked 9/6, 2020 at 17:13
3
The documentation for the Valgrind thread error detection tool Helgrind, found here
warns that, if you use GCC to compile your OpenMP code, GCC's OpenMP runtime library (libgomp.so) will cause a c...
Pesthole asked 17/5, 2012 at 19:5
2
Code:
# callee.py
import signal
import sys
import time
def int_handler(*args):
for i in range(10):
print('INTERRUPT', args)
sys.exit()
if __name__ == '__main__':
signal.signal(signal.SIGI...
Flavour asked 14/8, 2017 at 18:3
5
Solved
First, here's the concise summary of the question:
Is it possible to run an INSERT statement conditionally?
Something akin to this:
IF(expression) INSERT...
Now, I know I can do this with a sto...
Reest asked 28/7, 2011 at 6:44
2
Solved
The JavaFX docs state that a WebView is ready when Worker.State.SUCCEEDED is reached however, unless you wait a while (i.e. Animation, Transition, PauseTransition, etc.), a blank page is rendered.
...
Braw asked 18/1, 2020 at 18:6
2
Solved
This is a scenario you shouldn't ever do, but https://timsong-cpp.github.io/cppwp/class.cdtor#4 states:
Member functions, including virtual functions ([class.virtual]), can be called during cons...
Romp asked 16/3, 2020 at 20:41
4
Solved
I understand that assignment may not be atomic in C++.
I am trying to trigger a race condition to show this.
However my code below does not seem to trigger any such.
How can I change it so that i...
Squirt asked 29/2, 2020 at 10:56
© 2022 - 2025 — McMap. All rights reserved.