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

Show MessageBox modaly from background thread

In my Winform VB.NET application I am checking some fields. In case that one particular field is equal to true I need to show message. Normally it would be like this: If (myField) Then MessageBox.Show("Something is wrong", "Warning",…
DanielH
  • 953
  • 10
  • 30
1
vote
1 answer

Android singleton thread talking to server

This is mostly a design decision question. I have an activity, a broadcast receiver, and a class that talks to my server (call it ServerAccess). ServerAccess naturally needs to be in a thread of its own since it will be handling some network…
1
vote
1 answer

Update a UI from Background thread when app is also in Background to show Splash Screen on next resume

I want to show a Splash screen when app remain in background for more than 3 minutes. I started Background timer to trigger the function that will handle the UI update. - (void)applicationDidEnterBackground:(UIApplication *) if…
waseemwk
  • 1,499
  • 3
  • 15
  • 44
1
vote
1 answer

Can I use the Screen class in a background thread?

Sucessfully using the .NET class Screen in a background thread in a WinForms application, I wondered wether this is well-defined behavior. I'm currently reading the pixel dimensions of the primary screen like: var w =…
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
1
vote
1 answer

Thread "hanging" on Monitor.Wait after Application.Current.ShutDown()

I have a WPF application which used to shutdown via Environment.Exit. Since this caused problems with my automated UI tests, I changed the exiting application to Application.Current.ShutDown. This works fine, except there is a thread which is…
bas
  • 13,550
  • 20
  • 69
  • 146
1
vote
1 answer

Windows phone background transfer service is not working with the redirect urls with status 302

In my windows phone application, i want to download zip file from the server. I used Background Transfer Service for downloading file. And it works for me for some service urls. But now i tried with downloading file from a url, [Actually on hitting…
asitis
  • 3,023
  • 1
  • 31
  • 55
1
vote
1 answer

Caliburn Micro 2 EventAggregator PublishOnBackgroundThread

Can anyone explain any reason why and when should I use PublishOnBackgroundThread instead of PublishOnUIThread. I cannot find any use cases for usage PublishOnBackgroundThread and I am not sure what method should I use?
1
vote
2 answers

iOS performSelectorInBackground inside performSelectorInBackground

It seems that the function call [self updateUI]; blocked by boo. Is boo run in another background thread or same as foo as the code below? How can the [self updateUI]; not block by boo? - (void)MainFunction { [self…
daniel
  • 1,010
  • 6
  • 15
1
vote
1 answer

Thread created in service. After thread is executed, I need to create an activity. Do not know how to start an activity from a background thread

I have a service. The service starts another thread on completion of which I need to start a new fragmentactivity called MapPage.class which displays a google map. The thread gets a json from a server which contains GPS coordinates. I am saving…
user3360010
1
vote
1 answer

How to check previously started custom own service is running or not

Hi I have one activity and one service class from activity am starting service in one point i want to start service but at same point i want to check that service is already running if yes then i dont want to call start service if not then i will…
1
vote
2 answers

advice to manage properly NSURLSession

i begin to developp an iphone application and i need some advice about the NSURLSession and about how to manage properly the download and parsing of my data. i just finish to correct a bug for the download of my data in a nsurlsession, but regarding…
George
  • 332
  • 1
  • 4
  • 16
1
vote
3 answers

How to call a particular method in a background thread every X minutes in Python?

How to write a background thread in Python which will keep on calling a particular method every few minutes. Let's say, if I am starting my program for the first time, then it should call that method right away, and after that, it should keep on…
user2467545
1
vote
0 answers

Repeating Listview results with ListFragment Loader AsyncTaskLoader JSON

In my Listfragment I can load my JSON results from online server (1,2,3,4), but when I press home button and comeback to my App... now my Listview have a duplicate list (1,2,3,4,1,2,3,4), and sometimes this happen when rotate the screen. I read a…
1
vote
1 answer

If Background Worker is a background thread how come I can executed this code?

Researching I found out that Background Worker is a background thread, however when I run the following code Background Worker still runs until the end even when the main procedure is exited. Isn't this feature reserved to foreground…
1
vote
0 answers

What problems can I have with a background thread?

I have an application that needs to execute a code in background. I just created an empty background task and a thread. In theory this thread should be suspended after 10 minutes, but I saw that it was still alive. What problems can be generated…