Questions tagged as 'thread'

1
answer

Repainting screen every few minutes without crashing - C ++

I have the following situation: I have to repaint the screen every few minutes so that objects on the screen get stuck on account, but this has to happen in a way that the program will not crash. I have tried to make a Thread and call the...
asked by 08.06.2014 / 21:28
1
answer

Difference between Thread.Sleep and Task.Delay

I'm developing client / server communication, and using Task for asynchronous communication. Previously, I had already made another communication where I used Thread , works without problems and consumes little processing. In...
asked by 07.12.2017 / 20:08
2
answers

Thread size defined by code

I have a system that at times gets to use more than a thousand concurrent threads and unfortunately needs to run in 32-bit environment . By default , Delphi allocates 1kb for each new thread , which in a strong> becomes unfeasible for...
asked by 18.03.2014 / 13:32
1
answer

Relate 2 objects to a single reference / key

I have a while(true) that accepts multiple connections ( Socket and ServerSocket ). Each connection is passed to a Handling object that handles its read / write data. This Handling is passed to a Thread so you can accept connections and...
asked by 13.08.2015 / 18:11
1
answer

Because the compiler warns me Anonymous new Runnable () can be replaced with lambda

Because this code ( Thread ) shows this message ( in the compiler ), and how do you not show it again? Code: public void onCreate(Bundle icicle) { ... mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {...
asked by 03.07.2015 / 01:46
1
answer

How to create a Managed Thread in C ++ similar to the example in C #

In C # I use the following code to create the Managed Thread: Thread thread = new Thread(new ThreadStart(minhaFuncao)); In C ++ I did: using namespace System::Threading; . . Thread^ thread = gcnew Thread(gcnew ThreadStart(...
asked by 25.04.2014 / 14:17
3
answers

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

I have a program that reads the memory of a computer process continuously (with while (true) ), but this ends up requiring a lot of CPU, arriving at 20% used, my question is, how to decrease CPU usage without lose performance in the progra...
asked by 13.07.2017 / 23:56
1
answer

How to stop a Thread for a certain time, without using a Timer?

Explanation: Next, I have a TThread running parallel to Main Thread . And I have a routine to give a fade in the image. Well, the important thing is that I do this fade in a certain time in milliseconds, so I did the routine...
asked by 19.02.2014 / 17:58
1
answer

Clients do not communicate in the same multiplayer game in Java

I'm trying to make a simple multiplayer tank game by implementing chat. The game and the chat are all ok! However, I can not get 2 clients to see the same object Arena . In this case, each customer joining creates a tank in the arena. H...
asked by 13.11.2017 / 06:23
1
answer

Parallel Processing Routine C #

I would like to start a data-handling method whenever I receive a String with START content through the Transceiver.ReceiveLineEventHandler () event; however this method will have a processing time because there will be timeout among other resou...
asked by 25.07.2016 / 20:35