thread

What is the difference between wait () and sleep ()?

The Meaning of the two words looks quite similar. What is the difference between wait() and sleep()? When to use each?

Parallelize odd-even sort algorithm in python

I developed the following serial code to perform Odd-even sort, which first sorts The Odd/Even indexes and then odd/even. im ... Approach 3? Suggestions? If there is no other more efficient way, I would like help to implement one of the two suggestions.

Socket/Threads (Client / Server) Java

I have a very cruel doubt.I researched a lot and didn't find anything like it to solve my case. What I need is this: ... nte cliente = new Cliente("127.0.0.1", 12345); cliente.start(); //Coloca a thread do cliente para ser executada } }

How to make my program consume less CPU without disrupting its execution?

I have a program that reads the memory of a computer process continuously (with the while (true)), but this ends up requiring ... eep(3000, 200); one = !one; } } Summary: mem.Read reads the memory of a process. DrawGlow() write in memory.

Working with delay's on Android. Best approach?

Doubt I recently needed to use a delay in my application to execute certain code after some time. Searching "for the inte ... ery time interval, but rather a code that waits a certain time to then run, not blocking the main Thread of the application.

Difference between Thread.Sleep and Task.Delay

I am developing a client / server communication, and using Task for asynchronous communication. Previously, I had done anot ... 0); //Funciona, baixo CPU e espera o tempo //Task.Delay(2000); //Não funciona, alto CPU e não espera o tempo } }

Is there a difference between program, Thread and process?

I would like to know if there is difference between Thread, process and program ? These three words are widely used in the ... can be considered only one process ? I can't understand the meaning of each word, and I am confused at what each represents.

Are there differences between the terms Thread, multithreaded, Async and Await?

I asked this question here in the Ooverflow Stack: What is the solution for asynchronous processes in PHP? I did it becaus ... on of setTimeout No JavaScript )? I'm asking this because for me, who Program in PHP, it seemed to be all the same thing: p

Implement Runnable or extend Thread?

In several Java projects, I have seen these two ways to create Threads: With implements Runnable: public class MyRunnable ... } } //Iniciada com uma chamada "new MyThread().start()" What is the correct mode? is there any advantage or limitation?

How to create an Anonymous Thread in Delphi

I would like to know how to create an Anonymous Thread in Delphi, if I can show an example I will be grateful.

Example of thread Pool in delphi

As I do a pool of Thread, I need to run a process that contains several records, but I need to send on demand, send 10 and as ... assing to the method postJSON, in this method I put a sleep to simulate a return time I have of the post performed by idHTTP.

What are the states of a thread?

I have been searching in some places on the internet but I have not found coherence in the definitions given on the subject of thread in Java. What are the possible states of a thread and what are its definitions.

Run simultaneous threads in java with parameters, run method

I have a service today that I need to calculate its execution time with multiple accesses, for this I am trying to run simult ... fo("Requisição " + ": " + String.format("%02d segundos e %02d milisegundos", dif/60, dif%60)); } }.start(); }

What's wrong with my thread ultilizing synchronized-Java

I started to study tread I saw some examples of java7 and java8 ultilizing lambda, I arrived in a part to ultilize the synchr ... new Thread(() -> { new mainThread().imprimirValores("T3"); }).start(); } }

What is Runnable for?

I was thinking of creating thread one in my software, but I saw from the forums that Runnable helps in some way in creating a thread, and wanted to understand how it works.

Different behaviors between Linux and Windows using threads (pthreads)

I am using the linux pthreads library to try out the threads functionality, the code below prints 5 messages on the screen fo ... reads[i], NULL)){ printf("Erro ao sincronizar a thread\n"); } } sem_destroy (&semaforo); return 0; }

How to reuse a pthreads?

I am using pthread.h and using the following functions: // // Cria A thread // thread_argsPP[contthreadsPP] = cont ... closing the thread I can't recreate it, I would like to know if there is any way to reuse a pthread after pthread_exit(NULL).

What is a state machine?

I'm doing a tour of the site, researching about asynchronism, threads, parallelism and the like. Upon finding this Answer, ... ith asynchronism, threads and the like. What would be state machine? What is the relationship with the mentioned terms up?

Understanding threads in C#

I'm trying to figure out how to use Tasks and asynchronous methods in C#, but every place I see about this in internet menti ... this question is analogous to that I did, but considering now the relationship with the processor and not with the memory.

How to allocate more memory when running the app?

I am developing an app android Currently, when I run the APP, it starts reserving 36.62 MB of memory. I would like it ... ing name, long stackSize) But in the main Thread I don't know how to do Would Anyone know how to guide me regarding this?