python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Ending a loop on time expiration
I have a long computation in a loop, which I need to end prematurely if allowed compute time expires (and return a partially computed result). I plan to do it via SIGALARM handler and a timer:
// Alar...
user2052436
Votes: 0
Answers: 2
Can Atomic values change during an "&&" operation?
I am aware of the next scenario: (Weird formatting, I know)
private final AtomicBoolean aBoolean = new AtomicBoolean(true);
public void doSomething() {
if (
aBoolean.get() ...

Delark
Votes: 0
Answers: 1
Trying to skip recasting causes a race condition in OpenCL
I'm just going to start with code, then explain.
Say I have the following host code:
import pyopencl as cl
import numpy as np
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
host_arr = n...
Cmark
Votes: 0
Answers: 1
When to use a mutex and when not
I have a global variable named my_list containing a linked list (i.e., the variable is a pointer to the first member of the list). This variable can be edited only by two threads, thread A and thread ...
madmurphy
Votes: 0
Answers: 1