Questions tagged [multitasking]

Multitasking is the apparent simultaneous execution of two or more tasks by a computer. Relevant implementation and usage details vary per operating system and programming language, so always add tags for both the OS and language when using this tag. Multitasking questions must be programming related.

1008 questions
49
votes
5 answers

How can I run both of these methods 'at the same time' in .NET 4.5?

I have a method which does 2 independent pieces of logic. I was hoping I can run them both at the same time .. and only continue afterwards when both those child methods have completed. I was trying to get my head around the async/await syntax but I…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
46
votes
2 answers

How to respond to push notification view if app is already running in the background

I have something fairly simple I want to do. I attach a custom piece of data to some push notifications that I handle in -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions I look for the…
rustyshelf
  • 44,963
  • 37
  • 98
  • 104
46
votes
3 answers

Detecting user settings for Background App Refresh in iOS 7

Starting with iOS 7, Apple's Multitasking APIs allow apps to run in three new Background Modes: Background fetch, Remote notification content, and Background transfer service. Apple also gives iOS users the ability to control whether all apps are…
Sydney
  • 503
  • 1
  • 4
  • 8
43
votes
2 answers

Use of background/foreground methods in AppDelegate

I'm planning to implement multi-task in my app. I can see many methods here to do that in the AppDelegate like applicationWillResignActive, applicationDidEnterBackground, applicationWillEnterForeground, ... But.... I don't see the way they should be…
Oliver
  • 23,072
  • 33
  • 138
  • 230
40
votes
3 answers

multiple parallel async calls with await

As far as I know, when runtime comes across the statement below it wraps the rest of the function as a callback to the method which is invoked asynchronously (someCall() in this example). In this case anotherCall() will be executed as a callback to…
rovsen
  • 4,932
  • 5
  • 38
  • 60
37
votes
3 answers

Determine if an app is running in the foreground when a notification is received on iOS

I would like to find a way to see what app is running in foreground or if the home screen is displayed when a local notification from my app show up. For example i want to have different actions if there is in homescreen or in someone else app. I…
user1117453
  • 475
  • 1
  • 5
  • 8
37
votes
10 answers

Prevent iOS from taking screen capture of app before going into background

You all might know that iOS takes a screen shot of your application before throwing it into the background. This is usually for a better User experience like quick animation to bring the app back and so on. I don't want my app screen shot to be…
Mobilewits
  • 1,743
  • 4
  • 21
  • 34
37
votes
8 answers

Slide over and split view in iPad simulator

iOS 9 introduced slide over and split view for iPad. How do I simulate these features on an iPad simulator? I have tried swiping from right on iPad Air 2 simulator with no luck.
Khanh Nguyen
  • 11,112
  • 10
  • 52
  • 65
37
votes
4 answers

How to do multithreading, concurrency or parallelism in iOS Swift?

Is there any way to create a worker thread in Swift?, for example, if there's a major functionality that requires a lot of calculations and hence causes the main thread to delay for a few seconds, if I would like to move that functionality to a…
Martin Cazares
  • 13,637
  • 10
  • 47
  • 54
36
votes
9 answers

What does it mean to say "linux kernel is preemptive"?

I read that Linux kernel is preemptive, which is different from most Unix kernels. So, what does it really mean for a kernal to be preemptive? Some analogies or examples would be better than pure theoretical explanation. ADD 1 -- 11:00 AM…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
33
votes
4 answers

How to create a thread/Task with a continuous loop?

I am looking for the correct way/structure to create a loop in a Thread/Task... The reason for this is, i need to check the DB every 15sec for report requests. This is what i tried so far, but i get OutOfMemoryException: private void…
Willem
  • 9,166
  • 17
  • 68
  • 92
31
votes
5 answers

C# first class continuation via C++ interop or some other way?

We have a very high performance multitasking, near real-time C# application. This performance was achieved primarily by implementing cooperative multitasking in-house with a home grown scheduler. This is often called micro-threads. In this system…
Wayne
  • 2,959
  • 3
  • 30
  • 48
29
votes
2 answers

How to use AVCaptureSession with Slide Over and Split View in iOS 9?

My team is developing a set of SDKs for barcode scanning, ID scanning and OCR. We use device's camera, specifically, AVCaptureSession, to obtain video frames on which we perform our processing. We're exploring new iOS 9 multitasking features Slide…
Cerovec
  • 1,273
  • 10
  • 19
28
votes
6 answers

How to handle background audio playing while iOS device is locked or on another application?

Designing a generative music system for iOS, using OpenFrameworks, I'd need to provide a mode in which the user could listen the music produced by the application when: the device is locked the user uses another application Some applications like…
gluon
  • 662
  • 1
  • 10
  • 18
27
votes
4 answers

Does using Tasks (TPL) library make an application multithreaded?

Recently when being interviewed, I got this question. Q: Have you written multithreaded applications? A: Yes Q: Care to explain more? A: I used Tasks (Task Parallel library) to carry out some tasks like waiting for some info from internet while…
1
2
3
67 68