Skip to main content
Filter by
Sorted by
Tagged with
-6 votes
0 answers
73 views

INTRO I am getting unwanted pulsing and slowing down in rendering 2d particles, which should be drawn faintly (low alpha) and leave a fading trail under the influence of gravity. Below is a ...
0 votes
0 answers
17 views

I am facing an issue where my Actix-web server starts correctly, but the moment I hit the /upload_chunk endpoint from my frontend, the request hangs forever. After some debugging, I found that the ...
1 vote
0 answers
111 views

Consider the following code: #pragma omp parallel for (int run = 0; run < 10; run++) { std::vector<int> out; #pragma omp for for (int i = 0; i < 1'000'000; i++) { ... } } ...
Advice
1 vote
13 replies
104 views

I am trying to ensure that methods in my class can only be called by a single thread. So far tried to use ReaderWriterLockSlim to achieve this effect but this can cause potential issues if it is not ...
4 votes
4 answers
571 views

All the libraries I have come across that provide Swift concurrency functionality either depend on an Objective-C library or are wrappers around the C based GCD. (iOS and OS X) I'm just wondering if ...
Best practices
0 votes
3 replies
64 views

I trying to develop user-friendly program that do not block physical disk with 100% usage (so even entering My Computer takes around 10 seconds). My program calculate hash for many (180k) small files ...
0 votes
2 answers
121 views

I am trying to implement a lock-free multiple-producer-single-consumer ring buffer in C++. Here is the full definition and the test code. #include <iostream> #include <memory> #include <...
232 votes
5 answers
173k views

I notice that it is often suggested to use queues with multiple threads, instead of lists and .pop(). Is this because lists are not thread-safe, or for some other reason?
0 votes
1 answer
315 views

Consider this example: // thread A: start_transaction(); update_mysql(); commit_transaction(); // remove "key" from mysql tables remove_redis_cache("key"); // thread B: std::...
1 vote
1 answer
126 views

My code should print the numbers given as command line arguments. Instead it prints random-looking values. What is going on and how can I fix it? #include <stdio.h> #include <pthread.h> #...
2 votes
1 answer
63 views

I was trying to create a little Python program with a GUI using Pyside6. I ran into a problem when creating a thread for a worker to do a task (check files with a certain condition and then copy them ...
0 votes
0 answers
250 views

I'm working with a neural network project that requires to run two instance of the neural network program with different training set specifically two at the same time. For that I'm using ...
21 votes
4 answers
18k views

Example A: This causes the app to crash. DispatchQueue.main.async { let url = URL(string: imageUrl) do { let data = try Data(contentsOf: url!) DispatchQueue....
0 votes
0 answers
106 views

I’m currently studying Operating Systems at college, and my professor has started teaching us about threads and pipes in C. His teaching style is very practical — he expects us not only to understand ...
10 votes
2 answers
8k views

My web application(delpoyed on weblogic) went down, when I check the jstack info, I found most threads are BLOCKED on a org.apache.log4j.spi.RootLogger. The thread owning this lock is also BLOCKED and ...
855 votes
26 answers
414k views

I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Volatile variables are a simpler -- but weaker -- form of synchronization than locking, which in ...
4 votes
1 answer
699 views

I have to implemented a server which should accept more connections. Without any deeper thoughts I decided to use the new JAVA NIO.2 classes. My current approach is: final Semaphore wait = new ...
48 votes
2 answers
17k views

I have a general struct with settings and an extra variable setting that I want to tune and play around with. For all possible values in an integer range, I want to start a (scoped) thread with ...
0 votes
2 answers
59 views

Below is the code extracted from this repo: import os.path, io filename = "" n_chunks = 12 # Number of processes to use -- will split the file up into this many pieces def ...
8 votes
4 answers
5k views

I read that pthread is C library and is not compatible with C++ object model, especially when talking about exception handling. So I wish to know on linux system, how gcc/clang implements std::thread,...
0 votes
0 answers
43 views

I have a Python application that runs multiple tasks in parallel using ThreadPoolExecutor. I want all threads to log safely without race conditions. I also need two loggers: Console logger (prints ...
0 votes
2 answers
10k views

I have a "large" amount of data that needs to be copied every day. (6TB) It is 15 disks presented from a SAN over Fibre Channel and being copied to a local array consisting of 22 spindles. sources ...
5 votes
2 answers
25k views

We would like to optionally control the number of "threads" on our parallel loops to avoid overwhelming a web service (for example). Is it possible to specify a custom MaxDegreeOfParallelism on a ...
1 vote
2 answers
2k views

Let's imagine I have a thread with an asyncio event loop and other threads running. I may have to deal with synchronisation between threads with the lock mecanism for instance. But the lock may block ...
8 votes
4 answers
10k views

I want to load my add on a background thread cause it makes the SlidingMenu laggy upon opening and closing. Should I use a Thread/Handler? Or AsyncTask? String MY_AD_UNIT_ID = "----"; AdView ...

1
2 3 4 5
2822