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

Background Thread is not working as mentioned in any of its definitions

Definition: A Background tread stops executing when the Main thread leaves the execution. Source When I try it out, the background thread did not stop the execution even when the main thread completes the execution. Please check the example…
AjithKumar
  • 21
  • 6
0
votes
2 answers

Swift - Background thread crashes the app with authenthication

I am trying to add a Face ID/Touch ID/Code to my App, but I'm having some trouble when I terminate it: here's the error I get (with slight variations between one run and another, such as the number of the identifier changing): Can't end…
Vipera74
  • 227
  • 3
  • 17
0
votes
1 answer

Edittext loses focus when doing work on other thread

I am making an app that sends data over bluetooth to a HC-06. When I type something in the EditText and press send, the EditText loses focus. I found out this happens because I call a backgound thread with write(). How can I keep focus? messageEdTxt…
0
votes
0 answers

WPF print document in background

I've a realtime wpf application and sometimes I need to printout a document on a LAN printer. This is a part of my code: using (PrintDocument prnDocument = new PrintDocument()) { prnDocument.PrintPage += new…
user12123455
0
votes
1 answer

How to execute a method outside of run() in a backgroud thread?

I have socket connection established. I have service running which receives the intent from activity to start the SO Connection. I understood that socket connection should be in background thread. My socket connects properly. Now I would like to…
cantona_7
  • 1,127
  • 4
  • 21
  • 40
0
votes
1 answer

Using background threads for image processing in C++ in unity leads to a crash

I am trying to do some image processing in Unity and OpenCV in the background because it needs around 60ms-100ms to complete and slows down the application drastically when executed on the main thread. I do this inside a "camera frame available"…
0
votes
0 answers

Run ParseLoginInBackground in background thread until ParseUser is not null?

My goal is to process user login in a background thread that does not lock the UI thread. It appears that ParseUser.logInInBackground() is a Task, which is an asynchronous operation, but from experience you will quickly see that it is always…
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
0
votes
0 answers

UI blocks when download task in background session running in iOS Objective C

App freezes and UI blocked when download task is running in background session I have a background session as below -(NSURLSession *)backgroundSession { if (session==nil) { NSURLSessionConfiguration *configuration; // …
0
votes
1 answer

Castle Windsor issue when running background thread with QueueBackgroundWorkItem

I am registering a type as below using Castle Windsor container.Register( Classes.FromAssemblyContaining(typeof(MyApplicationService)) .BasedOn(typeof(IEventSubscriber<>)) …
User101
  • 748
  • 2
  • 10
  • 29
0
votes
0 answers

Sqlite operation hangs the UI in android screens

I am calling APIs inside intent service & saving the data from API response in local database sqlite suppose there are 1000 records to be saved in database. intent service action is in background without loader. Now during this operation I am trying…
0
votes
2 answers

how to crash the main process if there is unhandled exception inside background thread

I have a publisher, dispatcher, subscriber. publisher publish event through dispatcher to subscriber. subscriber is a com object embedded in S.exe can be callback from dispatcher.exe when specific event coming from publisher.exe. I expect any…
dhCompiler
  • 31
  • 4
0
votes
1 answer

calling a function on a background thread ios-what happens to the nested function calls

In my main code(in order to show UIActivityIndicatorView) I'm calling a function, foo() on a background thread. What happens to the functions called by foo() in turn? Will those functions also be called and executed in the same background thread?
Namratha
  • 16,630
  • 27
  • 90
  • 125
0
votes
1 answer

How to programmatically turn off Android 8’s background execution limit

I have a working app that receives Bluetooth-lowenergy notifications and responds by sending data back to the source in an async thread. I noticed under Android 8 the app is suspended along with the data send when pushed to the background. Can…
glez
  • 1,170
  • 3
  • 16
  • 42
0
votes
1 answer

Swift: Running code prevents other code until completed

I am calling an animation in ViewDidAppear, and then a bit later in ViewDidAppear I am calling a function which creates several arrays of UIImage objects and takes 4-5 seconds to complete. The animation meanwhile, is only 0.8 seconds long, and has a…
RanLearns
  • 4,086
  • 5
  • 44
  • 81
0
votes
1 answer

Run Service in background Thread

Can I run Service in background thread? I want to load data from database and during loading data i want progress bar to be indicating progress. First I have created task, run it in background thread and then update progress bar according to this…
Mr. Crow
  • 27
  • 12