Questions tagged as 'multithreading'

3
answers

What is the real advantage of using a CallBack and what is thread / multithread?

It has a lot of explanation of what is callback by the net and even a few sparse examples, but nothing that explains in practice and in detail a really important use (I did not find it). I already understood a bit of how to use and even mad...
asked by 02.01.2015 / 22:48
1
answer

Difference between Task and Thread

I need to create a C # executable and I have the doubts: Do with thread or do with task ? In practice is there any difference between using Task and the "traditional" multi-thread ?? Is it true that a task...
asked by 13.04.2016 / 18:57
4
answers

Java: When to use interrupt vs flags?

To indicate to a thread that it should "break" its work, Java provides a mechanism known as Interrupts : public void run() { while(!Thread.interrupted()) { // Fazer algo } } // para interromper minhaThread.interrupt(); Tha...
asked by 01.11.2016 / 15:37
2
answers

How to avoid an IllegalStateException: The content of the adapter has changed but ListView did not receive a notification?

I have Activity that displays a ListView , which is associated with Adapter "backed by" ArrayList global. If I add an element to this ArrayList , ideally I do it on the main thread and immediately call Adapter...
asked by 14.01.2014 / 12:39
5
answers

How to manage a SQLite connection between multiple concurrent threads?

So I'm having some problems with my connection to SQLite, where I'm not finding a workaround. Scenery My scenario is as follows: I synchronize the data of my application with a legacy system through a WebService; Synchronization is...
asked by 20.02.2014 / 14:35
1
answer

Synchronized in static methods, and non-static methods

If I have a class, where I have two methods one static and one not. Is the lock the same or not? How to do for the two methods share, the same synchronization mechanism, ie the same lock? class Foo{ public synchronized static void test(...
asked by 28.06.2015 / 23:11
1
answer

Thread control to prevent lock

I'm starting a crawler project and the idea is to download all content from a particular website. It already has some "usable" features. What is killing me is, I am doing it multithread, however the threads in a moment stop and I do not know h...
asked by 30.03.2016 / 16:23
2
answers

What are the differences between background and foreground threads?

What are the differences between these two types of threads and foreground ?     
asked by 17.09.2014 / 21:36
2
answers

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

The meaning of the two words seems very similar. What is the difference between wait() and sleep() ? When to use each?     
asked by 24.12.2016 / 03:54
1
answer

Parallel sorting algorithm Odd-even sort in python

I created the following serial code to perform the Odd-even sort ordering, which first sorts the odd / even and odd / even indices. import time def oddevenSort(x): sorted = False while not sorted: sorted = True #orden...
asked by 20.06.2017 / 21:30