Category "multithreading"

During thread contention how can I speed up this ConcurrentQueue implementation which uses ReaderWriterLockSlim over a regular Queue<T>

Question: How can I implement a faster thread safe queue to support an object pool when under heavy thread contention? Scenario: My overall final objective is a

Does user level threads take advantage of multiprocessing?

Does user level threads take advantage of multiprocessing ? I read one such answer here. But, it's not clear though. What does it mean by "user threads cannot

Getting STA error when try to open OpenFileDialog box in Excel addin project

I have created Excel addin project using Visual Studio to insert a data into database. The problem is I'm unable to open a File upload box in this. I am getting

Is Node.js worker_threads module truly threads or just processes with IPC?

Recent Node.js versions contain the new module worker_threads which is said to bring multi-threading to Node.js. However, it seems using processes underhood: ht

What is disadvantage of calling sleep() inside mutex lock?

For example: pthread_mutex_lock(); //Do something sleep(1); //causes issues waiting while holding lock pthread_mutex_unlock(); what is the so

How to set threading mode in SQLite with Entity Framework?

I'm using SQLite with Entity Framework Core (RC1). I read, that SQLite supports three different threading modes: Single-thread, Multi-thread and Serialized.

If async-await doesn't create any additional threads, then how does it make applications responsive?

Time and time again, I see it said that using async-await doesn't create any additional threads. That doesn't make sense because the only ways that a computer c

Why is this singleton implementation "not thread safe"?

1. The @Singleton decorator I found an elegant way to decorate a Python class to make it a singleton. The class can only produce one object. Each Instance() ca

How to run multiple threads in C++ code

I'm a beginner for c++. I wrote a program to extract data from one DB and store those data to another DB. I just want to add multiple threads to speed up the pr

How can I create single-thread coroutine context under Common pool in Kotlin?

Short requirement: have ability to create corotine context, which will executed in the single thread only (e.g. without parallelism). Additional requirement: i

How do I safely modify JavaFX GUI nodes from my own Thread?

I try to change a JavaFX GUI node in a thread, but I see the following error: Exception in thread "Thread-8" java.lang.IllegalStateException: Not on FX ap

Multithreading matrix multiplication in C#

I have a task - write multithreading matrix multiplication. Each vector product must be calculated in new thread.(If we have matrices n by m and m by k we must

Suspending threads while running multiple AsyncTasks in nested fragments and it makes app slow

Here I'm calling web services in nested Fragments which has TabLayout and ViewPager using AsyncTask. I've tried AsyncTasks by calling them all in onResume metho

Do variables/flags can be affected by another thread on a non-synchronized method?

For example I have a non-synchronized method like this: public void nonSynchronized(){ boolean flag = false; if(/*some condition*/){ flag

Static method behavior in multi-threaded environment in java

class Clstest{ public static String testStaticMethod(String inFileStr) { // section 0 // section 1 // do

Multithreading Python3 whit Sql-Injection

Good afternoon, I have a question that I cannot solve. I want to do a SQL injection in Hack The Box (Legal Platform). The case is that I am trying to execute a

Merging three threads in Java

I am trying to create few flows in java, my program must to create 3 threads and 1 main thread, and than stop. I created class with implemented Runnable class N

When to use std::launch::deferred?

Lines from Anthony William book: std::launch::deferred indicates that the function call is to be deferred until either wait() or get() is called on the fu

how to see which process owns a python thread

My understanding from multi-threading has been that one process (cpu core) can have multiple threads running with it. So far in python when I want to check whi

How do I refactor my code to call AppDelegate on the main thread?

I recently started migrating my project from Swift3/Xcode8 to Swift4/Xcode9. My app crashes at runtime because the main thread sanitizer allows access to UIAppl