multithreading Questions

2

I Am trying to send a signal from a child thread to the main thread in a multi-threaded program (cannot use multi-processes). Unfortunately even after exhausting all the reading materials available...

2

Solved

I'm learning pthread and came across reader writer lock. The scenario is very simple; a global variable being shared by all the threads, reader keeps printing the current value of that same global ...
Aedile asked 20/10, 2013 at 20:44

1

Anyone knows what kind of UB is this? The following code deadlocks on jthread destruction when built with MSVC 19.29.30148, sometimes it deadlocks after std::cout and sometimes before. This is some...
Ozell asked 18/9, 2023 at 10:31

5

Solved

I am currently thinking about how to design a multithreading system in Java that needs to do some heavy network processing and database storage. The program will launch three basic threads at first...
Tension asked 28/8, 2011 at 23:19

3

Why is Bill Pugh's Singleton design pattern thread safe? public class Logger { private Logger() { // private constructor } // static inner class - inner classes are not loaded until they are ...
Josephjosepha asked 9/6, 2018 at 6:0

3

Solved

Here the code which download 3 files, and do something with it. But before starting Thread2 it waits until Thread1 will be finished. How make them run together? Specify some examples with commentar...
Rapture asked 3/9, 2013 at 21:48

2

Solved

I have a simple object @Data @Builder public class Address { private Long id; private String street; } I make delombok of @Builder annotation and I see next code generated @Data public class ...
Faulk asked 8/3, 2018 at 8:28

2

From the docs - How many workers, DO NOT scale the number of workers to the number of clients you expect to have. Gunicorn should only need 4-12 worker processes to handle hundreds or thousands of ...
Dyspepsia asked 9/11, 2021 at 11:16

5

Solved

Here on stack overflow I've found the code that memoizes single-argument functions: static Func<A, R> Memoize<A, R>(this Func<A, R> f) { var d = new Dictionary<A, R>(); r...
Confess asked 12/12, 2013 at 13:18

3

I have seen several other questions on the forum that talk about this schedule() function, but my question is a bit different. I have seen several discussions and literature about it's theoretical,...
Orvas asked 19/12, 2013 at 10:32

2

Consider the following two snippets of code where I am trying to launch 10000 threads: Snippet 1 std::array<std::future<void>, 10000> furArr_; try { size_t index = 0; for (auto &...
Sales asked 22/6, 2017 at 2:24

9

Solved

If I have two threading.Event() objects, and wish to sleep until either one of them is set, is there an efficient way to do that in python? Clearly I could do something with polling/timeouts, but I...
Lorca asked 7/9, 2012 at 12:1

2

I'm building a Python API around a black box .NET DLL using Python .NET. The DLL is only doing networking operations. The DLL require me to run a windows message pumping loop, otherwise the network...
Aguila asked 18/8, 2017 at 9:26

3

In theory, the JDB (java debugger) allows for a single thread to be killed. In practice, is it possible? Here I attach jdb to my JVM, which has an agentlib at port 8000: $ jdb -attach 8000 > ...
Xylidine asked 18/11, 2011 at 21:40

2

Solved

All, Referring to the question in std::lock still caused deadlock I still couldn't figure what is the problem in the below code. Can somebody please explain the problem and how to fix this? Why do...
Sniffle asked 21/11, 2019 at 10:12

0

I have been experimenting with a simple true/false sharing benchmark, which does regular load+increment+write on a pointer. Basically this: static void do_increments(volatile size_t *buffer, size_t...

2

I am right now developing a PyQT5 application an use multithreading to avoid freezing of the GUI. Unfortuneately the Visual Studio Code debugger does not stop on breakpoints inside the executed thr...
Frere asked 11/4, 2022 at 20:58

5

Solved

I'm embedding the python interpreter in a multithreaded C application and I'm a little confused as to what APIs I should use to ensure thread safety. From what I gathered, when embedding python it...
Materiality asked 16/5, 2012 at 19:43

14

Solved

How do I get a thread to return a tuple or any value of my choice back to the parent in Python?
Imparity asked 11/12, 2009 at 6:0

4

Solved

My ThreadPoolExecutor is failing to create new threads. In fact I wrote a somewhat hacky LinkedBlockingQueue that will accept any task (i.e. it is unbounded) but call an additional handler - which ...
Wiencke asked 18/3, 2013 at 20:2

3

Solved

I have a list of work-unit and I want to process them in parallel. Unit work is 8-15 seconds each, fully computational time, no I/O blocking. What I want to achieve is to have an ExecutorService th...
Kiangsu asked 15/12, 2020 at 11:16

4

I am using Threading module in python. How to know how many max threads I can have on my system?
Abruption asked 25/2, 2018 at 6:27

5

Solved

As DateTime cannot be declared as volatile, is this right? private DateTime _time; public DateTime Time { get { Thread.MemoryBarrier(); return _time; } set { _time = value; Thread.MemoryBa...
Tillman asked 28/1, 2011 at 16:13

5

Solved

My app is working well and I didn't get this error on Xcode 13.4, Is it Xcode 14 beta bug or I'm doing some bad threading?! Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread ...
Electrify asked 7/6, 2022 at 14:32

5

When I am debugging within Visual Studio, for some reason when debugging a certain thread, Visual Studio will just jump around to different threads. How do I change to behavior so it sits on the s...

© 2022 - 2024 — McMap. All rights reserved.