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
0 answers

How to detect that CLR stops a background thread

When all foreground threads are gone, CLR stops the background threads. That can be read a lot. But what I want to know is how the background thread or the application can detect this situation. Why? I consider it a bad style to let background…
Stefan Bormann
  • 643
  • 7
  • 25
1
vote
0 answers

Keep recording a route which the user is driving with MapBox SDK, even when the app goes in background

I'm working on an app where a user can 'record' a route which he/she is driving with his car. Every 1 sec we save a coordinate to a list and every 30 seconds we also save the coordinate to the database for this, but this only works when the app is…
HoereeBauke
  • 544
  • 1
  • 5
  • 14
1
vote
1 answer

Thread stops running when in background using JobService

I am creating an sleep timer app that gradually lowers the system volume as time goes by. If the user sets the time to 30 minutes then the volume will decrease at 15 minutes then 7.5 minutes, etc. I currently have the volume decay being sent to a…
Austin
  • 11
  • 1
1
vote
1 answer

Work in background thread stopping UI thread

I am fetching and processing some JSON data in a background thread...even then I can see warning in my log saying that the application is doing too much work in ht ui thread. I cannot understand what is wrong. Here is my method: private void…
user9780359
1
vote
1 answer

Problems reading data on onSensorChanged

There is data on onSensorChanged that comes continuously while the sensor is turn on. I want to: Turn on the sensor for 10 seconds and read the data once in 10 seconds intervals. Turn off the sensor for 20 seconds. Repeat the same thing…
1
vote
0 answers

Job scheduler not repeating its job on give time in android

Actually in android want to run my job after 1 minutes whether app is active or not but it runs my job after around 3,4 minutes which I don't want please give me suggestion how can I run it according to my given time. Thanks in advance. Here is my…
1
vote
3 answers

c# which is the best way for doing a larger task without interrupting whole program

My question is i want to execute some operations like fetching the data ( format is string )from some URL . and i want run this process to be background. i have to call this operations whenever user needs this. like if a user clicks a button…
Lazy Programer
  • 171
  • 1
  • 1
  • 12
1
vote
2 answers

Initialising UIView in main thread from a background thread

In a global, async closure, I'd like to initialise a UIView on the main thread. I thought this code would possibly do it, but I get an Analyser warning: UIView.init(frame:) must by used from the main thread only. let view: UIView = { // Line with…
1
vote
1 answer

Terminated due to signal 9 when i pressing 1 time Home button in middle of background tasks (using GCD) in iOS app

I want to index the part of content through background thread each time the user run the app, but when i pressing 1 time Home button in middle of background task and app goes to background , this message i received : "Terminated due to signal 9". i…
1
vote
1 answer

Visual Basic Updating GUI .text property on background thread

I'm a bit rusty to visual basic, however I need to use it for a project I'm working on that requires a .NET language. I noticed when writing a bit of code to update the text value of a textbox in a windows fourm application 'weve read the…
1
vote
1 answer

save image with QRCode in document directory in background thread

I am developing an app in which I have picked 10 images from iOS gallery and then generate QRCode of all the images and then save everything in document directory using background thread but the problem is when I change the tab bar means to say…
Vishal
  • 8,246
  • 6
  • 37
  • 52
1
vote
0 answers

Running background thread on OpenShift Online

I am trying to adapt a custom socketserver.TCPServer which uses a handler inheriting from http.server.SimpleHTTPRequestHandler to run on OpenShift Online. The original code runs a non-halting background thread which crunches data from third party…
Mirac7
  • 1,566
  • 4
  • 26
  • 44
1
vote
2 answers

Most efficient way to terminate a Thread if an FX thread is terminated in Java

I've written a simple JavaFX application that is obviously running on FX application thread. The application needs some background processing in an infinite loop running on a separate thread(not FX thread) where I call Platform.runLater() to update…
Umar Tahir
  • 333
  • 1
  • 7
  • 15
1
vote
1 answer

UWP bitmapimage on background thread

I have a simple question. In my UWP app I am using multiple threads and while on a background thread when i try to create a simple BitmapImage by using code: var image=new BitmapImage();. It throws an exception The application called an interface…
1
vote
1 answer

How to make network call when the app is in background too

I have an app if it goes background it has to make network API call every 1 minute. So far what I studied suggests it's not possible. Is there any way or workaround to do it But I couldn't find any so far ? Thanks
King
  • 3,457
  • 3
  • 12
  • 22