многопоточность

Queuing processes - java

I need to do it in java, so that I can put processes in a queue and they are executed in turn. Tipo: One process monitors th ... } catch (IOException e) { e.printStackTrace(); } } })); }

Pause in C#

Tell me, how can I pause the program for a while? System.Threading.Thread.Sleep(500); Hangs the entire program.

Java Timer. Countdown after the start of the stream

I use Timer and set the timer via the shedule() method, setting a repeat every N seconds. But I ran into a problem, I need to ... impleName() + " and it was " + new SimpleDateFormat("HH:mm:ss").format(new Date())); bot.setTaskForTimer(); } }

Python. Is it possible to run a single thread many times?

I recently started studying threads in Python, specifically the threading module. And I need to make it so that after the en ... оторый нужно выполнить во время работы потока #событие: run = False How will this be implemented correctly? Python 3.8.3

Parallel execution of while loops in Python 3

I need to add game time that will go several times faster than normal time, doing this through a while loop. All loops should ... ime2)) if health <= 0: print("Конец игры. Ваше здоровье упало до нуля.") time.sleep(3) break

Python functions and threads

There is a loop that runs a loop that runs a function in 5 threads. The loop while looks for links on the page (there are alw ... 0])) th.start() j += 50 Stop all threads when pausing a single function already looked at, not suitable.

HashMap Thread Safety in Java

I have met many articles where they suggest using java.util. HashMap from different threads as a completely possible option, ... ronized, if the threads don't know about the Map change, since its fields are not volatile. Please help me clarify the point!

Volatile and CPU caches

Hello, here is such a question. As far as I understand, Volatile variables are required to be permanently written to memory. ... But if on one core, then the cache is one and all threads write there, then the meaning of volatile? Or I don't get it right.

Process synchronization and messaging without blocking the thread by waiting

There is a code that tracks that only one instance of the application will be started. When you try to start a second instanc ... e?.Close(); } private static void OnApplicationExit(object sender, ExitEventArgs e) { DisableSingleInstanceWatcher(); }

working with c++threads

I made synchronization of the work of two threads created by the example class by some super crutch method (using verificatio ... d::chrono::seconds(10)); ex.restart(); std::this_thread::sleep_for(std::chrono::seconds(9999999)); return 0; }

Why does the CreateThread function start the function immediately after creation?

There is a problem with parallelizing the output to the console screen: History: execution of WriteConsoleOutputW takes long ... hreads, which is time-consuming. Are there any options for how to make a call launch? Addition: Here's what I'm rendering

QThread:: sleep kills a thread in Qt

I wanted to write a simple application using QWaitCondition. There was a problem with the ActionThread threads, namely, when ... i; } void Widget::keyPressEvent(QKeyEvent *event){ qDebug() << QChar(event->key()); condition.wakeAll(); }

'int' object has no attribute 'recv'

I try to make two functions run simultaneously using threads, and it returns a data type error, although it does not return a ... equest_data_thread = threading.Thread(target=request_data) connect_thread.start() request_data_thread.start() sock.close()

The thread stop is looped, and the others are not working

When creating 10 threads of those who make +1 and those who make -1 of a synchronized number ( the limit to >= 0 and imp ... те сюда описание изображения][2]][2] [1]: https://i.stack.imgur.com/XyMss.png [2]: https://i.stack.imgur.com/xga2u.png

Learning multithreaded programming

Looking through vacancies for the position of C / C++ programmer, I noticed that knowledge of syntax, OOP and algorithms is n ... rent technology, the basics that can really be comprehended in a week of active and persistent study. Thank you in advance!

Thread pool in Java

Good afternoon! Let's say we have the code: final ExecutorService es = Executors.newFixedThreadPool(2); Each time a new thre ... removed from the pool. The question is, within this model, why do ThreadPool need 2 sizes : maximumPoolSize and corePoolSize

What is a stream in C++?

I know that in C++ there are no threads of their own, only the implementation through I/O, and there through winapi it seems, ... while you know what you are dealing with? And then for example in the links 1 and 2 a solid dark forest and nothing is clear.

Using the sleep method()

Good afternoon, everyone. Need a tip: the program should change the label on the button sequentially from "10" to "0". To mak ... = String.valueOf(i); button.setText(iString); } } catch (InterruptedException qq) { qq.printStackTrace(); }

System.InvalidCastException exception in a thread (Task)

Good afternoon. There is such a construction necessary for waiting for the page to load fully in the webbrowser component: ... r1.ReadyState != WebBrowserReadyState.Complete) Please tell me why this is happening and how it can be circumvented? Thanks.

Interrupt method: what it does and why it is needed

Good afternoon. I read about multithreading and ran into an incomprehensible interrupt method ? Please explain what it does and why it is needed ? I understand that its task is to "wake up" threads that have called the wait, sleep methods.