Questions tagged [background-thread]

A background thread is a thread that not directly driving the application but does some processing asynchronously.

Many UI toolkits require the use of background threads for anything that takes longer than a couple of milliseconds in order to keep the UI responsive.

Background threads are referred to as daemon threads at times.

Often background threads take care of recurring tasks, like cleaning up caches or similar.

Since the term 'background thread' is not very specific you might want to consider more specific tags related to the actual technology you are using.

If your question is independent of the actual technology this tag is a good fit.

Background Thread in .Net
Background thread in java

224 questions
1
vote
1 answer

Access a running background thread VB.NET VS2008

I created a background thread that get's data and returns it to the main thread; this works. Now I want to be able to stop the SQL request from the main thread (probably on a button click). This is my test code for creating the thread (working):…
1
vote
0 answers

How to run, restart and kill thread in Objective C?

I have a function which update pagination i.e. calculate total number of pages. - (void) updatePagination{ if(!paginating){ NSLog(@"Pagination Started!"); paginating = YES; totalPagesCount=0; …
Soniya
  • 600
  • 7
  • 34
1
vote
2 answers

upload files in background via ftp on iphone

i'm trying to establish an FTP connection within an app. i want to upload several files to a FTP server, all files in one directory. So at first i want to create the remote directory. - (void) createRemoteDir { NSURL *destinationDirURL = [NSURL…
m Jae
  • 725
  • 2
  • 8
  • 20
1
vote
2 answers

Android: using multithreading to make UI responsive (archieve smooth scrolling)

My activity is to download and display announcements (from announcements web-service). In order to keep UI responsive I do following actions in background threads: 1) upload XML (data are stored in XML), 2) process XML, 3) upload images. Besides, I…
Eugene Chumak
  • 3,272
  • 7
  • 34
  • 52
1
vote
1 answer

Modal alert in background thread in iPhone

In my iPhone app, main thread creates a background thread which does a lot of work and in some cases needs to ask user for their decision. When user is asked the question, background thread should stop working and should continue only after user has…
Nadya
  • 73
  • 2
  • 10
1
vote
3 answers

UI + Worker Multithreading issue

I'm having trouble performing a search operation in the background, and displaying the results to the user in the foreground inside a list box. The program uses SendMessage to send the query results back to the GUI. When the program is closed, the…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
1 answer

How to use RxJava / RxAndroid in Android to make slow network call and update the UI?

I have started reading about RxJava / RxAndroid, but I can't find simple tutorial that covers typical thing, like getting network data and updating UI with the result. Many tutorials cover scenario like running one or more background tasks, that…
Kamil
  • 13,363
  • 24
  • 88
  • 183
1
vote
2 answers

Event on view rendering finished

After navigating to a new view i want to start a background thread, which does some validation and reports changes to my view. I am building the ui and starting the thread on AfterNavigationObserver#afterNavigation. Most of the time this works, but…
WaTho
  • 41
  • 4
1
vote
0 answers

React Native : want to run a function from app, and it would be not stop if app in background or foreground state

I have a function that has a for loop and I trigger the APIs in the queue it's working very well but if I change my app state foreground to background my queue was paused until I reopen the app. That function doesn't need to stop until I stop…
1
vote
1 answer

How to fetch data with CoreData in the background?

I need to enable my app keep the data for a long time. When I started reading articles on the topic I faced 3 different approaches and realized I do not see any differences. Please explain pros and cons of the following fetch…
1
vote
1 answer

coredata update json background thread problem

I have the following coredata singleton class in my appdelegate i try to update the data from json but in my app when it launches i get different error messages regarding thread like Main Thread Checker: UI API called or observer of…
keyvan
  • 17
  • 1
  • 5
1
vote
1 answer

Background Thread slowing Main UI Thread visual basic

I would like to show a gif inside a Picture Box for 2 seconds on a separate thread from the main thread. I am running a timer that moves a Picture Box with an Image on the main thread. To test I created a Picture Box and added same Image I start the…
Vector
  • 3,066
  • 5
  • 27
  • 54
1
vote
1 answer

Run the tasks in background ( AsyncTask )

In NoteInfoactivity I have a code below, but Note allNote = NoteDatabase.getInstance(getApplicationContext()).noteDao().getAllNoteId(noteID); is executed in main thread. How can i execute it in background? what is the best way? public class…
1
vote
0 answers

Need Background task recommendations for updating firestore data

I'm looking to update the data in Firestore by using some kind of background task. Currently, I'm using a ListenableWorker, since Firestore operations are asynchronous and listenable worker supports asynchronous work with SettableFuture. But…
1
vote
1 answer

Prevent Background Thread "Timeout expired." error

I have the following portion of code on a Click Event on my page: Dim ts As New ThreadStart(AddressOf SendEmails) Dim t As New Thread(ts) t.IsBackground = True t.Start() This actions the SendEmails method which sends out 1000s of newsletter…
Curtis
  • 101,612
  • 66
  • 270
  • 352