Questions tagged as 'hilos'

1
answer

Dekker Algorithm for 3 processes is blocked

Good morning, I want to implement the famous Dekker Algorithm to solve the problem of mutual exclusion for 3 processes instead of 2. I have 3 processes, P, Q and R, each process has its Boolean variable indicating if it wants or Do not enter the...
asked by 18.11.2016 / 16:51
0
answers

How to execute function in an interval?

I am trying to execute a function in the background every 5 seconds in which I check the data of an object and modify it. I have found this form (see code) but I can not get it to run when I deploy the Django server. Code import threadin...
asked by 20.07.2018 / 12:18
1
answer

Problem with threads in python.

I'm having some problems finishing some threads. My program has a function runthreads (): def runThreads(): """ Creates and runs threads. """ t1 = threading.Thread(target=netstatCapture, name='netstatCapture') t2 = thre...
asked by 18.03.2018 / 18:39
0
answers

Threads in JFrame [closed]

I need to make a Digital Clock, but for this it is necessary to create a main class and a JFrame, in which I have to inherit the Thread class, and not implement Runnable. Can someone tell me how to inherit the Thread in the JFrame?     
asked by 24.04.2018 / 00:52
1
answer

How do I execute two events at the same time?

I am developing a game which is for 2 players, in which two picture boxes must move if the W or S key is pressed, a PictureBox moves, and if you press the Up key or the Down key the other pictureBox should move, but both must react at the same t...
asked by 11.07.2017 / 04:44
0
answers

How to change the order in which it is printed in a program with MultiHilos?

Paralleled program, which uses n independent threads to process a given list of m requests. The threads take the requests in the order they are given in the entry. If there is a free thread, it immediately takes the next request fr...
asked by 15.04.2017 / 23:44
1
answer

Unexpected behavior with (user-threads | fibers | coroutines)

I'm testing libcoro , a very simple and low-level library that provides coroutines more or less portable . Supposedly, it is valid for systems in production. My code is as follows: #include <stdio.h> #include <signal.h> #i...
asked by 18.12.2016 / 23:41
0
answers

Overwrite, reuse Messages (Handler)

When executing the following code: @SuppressWarnings({"BusyWait"}) @Override public void run() { Bundle datos = new Bundle(); Message msg = new Message(); for(Integer i = 0; i <= 10; i++){ try { datos.putStri...
asked by 18.10.2016 / 23:49
0
answers

ReentrantLock and Condition

Could someone explain to me how to use .newCondition of the'ReentrantLock' class and .await of the interface Condition ? and, how does it work internally?     
asked by 03.03.2016 / 02:12
1
answer

Using AsyncTask brings me problems with Thread.sleep ()

I have a problem with the use of threads in android. It's very simple, I have a table with buttons on the screen. I try that, randomly, one changes color and after half a second, return to the original color, so that at the moment another one...
asked by 06.03.2017 / 16:12