Search results for

offloading

179 results found

Post

Replies

Boosts

Views

Activity

Reply to Are Multiple UI Threads Possible?
Let's be plain about it: UIKit (which basically cover all of the UI Thread territory) isn't thread safe and the things that draw the view hierarchy run on the main thread. The rare exceptions are outstanding enough that they get mentioned explicitly in the documentation as being thread safe or being designed to run in another thread/queue.On the other hand, it really depends on what you're doing and what sorts of latency you're allowing for how much you can offload to another thread. Because the straight forward way of offloading things that were originally done on the main thread to a background thread ends up looking a lot like this: You've got an action method that's responding to the user tapping a button. Gather up all of the relevant parameters and dispatch a block to the worker queue.Inside that worker block, do the computation and work. Gather up the relevant results and dispatch a block to the main queue. Inside this second block, use the passed in results to update the user interfa
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’17
Reply to iOS 10 - App is not working in background mode after 3 minutes
If there is a way to achieve, then How can I upload/download data after 30 minutes of app went backgrond?.Two things:iOS provides no general mechanism for an app to schedule itself to be resumed at a specific time.If an app is running, it has full access to the network, regardless of whether it’s in the foreground or background. The only gotcha is that devices with WWAN will typically shut down Wi-Fi when the device is locked.I’m confused about your upload requirement. If you’re suspended in the background there should be no need to upload data because you can’t possibly have generated new data that warrants uploading.As far as downloads are concerned, my standard recommendation in this space is to have your app offload the decision about what data needs to be dowloaded to a server. When the server decides that the app needs some data it can send it a silent push notification to the app, in response to which the app can kick off the download.IMPORTANT You can use silent push notifications as a mechan
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’17
Reply to How to receive UDP packets that have no checksum
Honestly that sounds like a bug in the driver; it seems obvious that the driver’s checksum offload should behave the same as kernel’s.I don’t know if there’s a way around this; if you want a definitive answer, you should open a DTS tech support incident and I, or one of my colleagues, can dig into it.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Feb ’17
Reply to How to receive UDP packets that have no checksum
Thanks for the prompt reply.The problem however, seems to be that the checksum verification is offloaded to the NIC. There are kernel parameters (ending in hwcksum_rx for example) that indicate this. This means that the NIC does not even deliver the UDP packets with a zero checksum to the system and the function udp_input_checksum is not even called.It also seems that the involved kernel parameters cannot be altered. (not even when the System Integrity Protection is switched off, which would not have been a viable solution anyway).So the question remains, how to get the UDP packets with their checksum set to zero?
Feb ’17
Reply to Can an app update without being open?
My app lets you know if there are upcoming events in your area and it would be nice if it could check every week or so with my server to see if there were any and update the users local Notifications. So this would require it to run in the background and access the web.iOS has a mechanism for this, namely background fetch. You learn more about it in the Background Execution section of the App Programming Guide for iOS.However, if your app is not being run regularly by the user then it’s likely that your app will fall off the background fetch radar. The best way to meet your requirements is to offload this periodic work to a server. That is, have your server poll the event database and, if there’s anything relevant for this user, post a push notification. That is power efficient (no code needs to execute on the user’s device) and reliable.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’16
Reply to Does Xcode use GPU to build?
Xcode is not itself a compiler, it just hosts the compiler. For Obj-C, the current (preferred) compiler is clang. You can visit clang.llvm.org and if your question isn't answered by the information on the site, there are mailing lists where you can ask about implementation details and strategy.My guess, though, is that the compiler isn't designed to use the GPU.>> No reason for it to need the GPU when buildingNo particular reason, but it's certainly possible that it might use something like OpenCL to offload some processing onto the GPU.
Nov ’16
Reply to Copying NSMutableArray within a NSOperation?
No, atomicity doesn't change anything. The value of the property is a pointer (to a mutable array), so atomicity would protect only the accessing of the pointer, not the data structures pointed to.It's a complete waste of time looking for a generic solution, such as encasing random blocks of code in a synchronizing construct. You'll either leave hard-to-find bugs in the edge cases, or hard-to-find deadlocks.In this case, we can't even speculate on a real solution, because we don't know what's going on. We don't even know if scanQueue is serial or concurrent. We don't know what the point of using NSOperation is: is it to get parallel processing, to offload long tasks from the main thread, etc? Maybe NSOperation isn't the best API to use for this, perhaps direct use of GCD is easier. The code you showed has each NSOperation using, or not using, the resulting array of the previous operation, according to the timing of the block placed back on the main thread. We don't know the consequences of this sort
Topic: UI Frameworks SubTopic: AppKit Tags:
Apr ’16
Will Cordova applications that download additional JavaScript be rejected
My team has been toying with the idea of developing an iOS app using Cordova, and recently, we've been looking into offloading as much of the main JavaScript as possible to our server, so any major bug fixes can be deployed quickly.The idea would be to have:the native app containing all HTML, CSS, plugins and Cordova files (all native code would be here)the main JavaScript added to the pages as external scripts from a servera device-ready function for each page that will set up and start the main JavaScript once it's availableI have seen comments that Apple could be trusting of code that runs in a webview, but it does seem like projects like this could be a security issue.Thanks!
3
0
1.1k
Oct ’15
Metal Matrix Multiplication reference code
Hi,I have just started experimenting with Metal. I really just want to offload a few matrix multiplications to the GPU.So, I downloaded this perfectly applicable example code and ran it: https://developer.apple.com/library/ios/samplecode/MetalPartialSumsCompute/Introduction/Intro.html#//apple_ref/doc/uid/TP40015013-Intro-DontLinkElementID_2I can run it on my iphone 6 but there are several issues:It crashes sometimes (EXC_BAD_ACCESS (code=1), and other malloc errors). That's a bit worrying for reference code.It says I am getting approximately 0.04 gflops/sec[sic] using either CPU (Accelerate) or GPU (Metal). I believe I should be getting 3+ GFLOPS from the CPU? (http://www.anandtech.com/show/8554/the-iphone-6-review/3) I'm not sure what to expect from the GPU/Metal but I am assuming a considerably higher number.Here's example output:2015-12-02 14:48:27.772 MetalMatrixMultiply[5477:2056717] >> [12] Matrix Dimensions: A = [1248 x 1137], B = [1137 x 2004], C = [1248 x 2004], lda = 1248, ldb = 2008,
1
0
2.1k
Dec ’15
How to increment ios badge notifiation count when app is not running?
We are already done with the initial setup for implementing Push notifications and are able to send/receive notifications successfully.Now, we have been looking for the possible solutions to handle badge count increment from ios app (especially when app is not in foreground) -1. Delegate the badge count calculation to server side. - If we think of offloading the task of badge calculation to app server, then question arises is that, how server side will get to know about the count of viewed notifications so that badge can be decremented accordingly.2. Use UIBackgroundModes and call 'didReceiveRemoteNotification:fetchCompletionHandler' method. - Apple says, this method will get called when my app is either in foreground or background state. With this we should be able to track the count/notification info even when the app is in background & thus it probably enables us to do the necessary calculation in iOS app itself. However, we have noticed that this method doesn't invoke when app is in backgroun
1
0
5.1k
Jul ’15
Is there a way to determine when the app was restored from being offloaded in iOS 11?
Is there any callback available in iOS framework SDK to find out when an iOS app got restored being offloaded in iOS 11? I need to check the occurrence when the app got restored from the offload of unused apps. So, is there any callback or event to find the same in the iOS framework? Any suggestions are much appreciated. Thanks,
0
0
420
Jul ’21
Bluetooth Logging Buffer Size
Hey guys,I'm trying to sniff some bluetooth traffic over a period of time for post-processing analysis. So far, I've followed the instructions [1] to install the profile [2] which enabled Bluetooth HCI logging and how to offload it - it's working great by the way.So far the logs all seem to be 2.5MB so I'm curious if there is a way to control the rolling buffer size.What kind of Bluetooth configuration options are available? How do I dig into this?Thanks!--James[1] https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/Bluetooth_Logging_Instructions.pdf[2] https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/iOSBluetoothLogging.mobileconfig
0
0
1.2k
Nov ’17
Offloading task from the cooperative thread pool
Hi, When using Swift Concurrency blocking tasks like file I/O, GPU work and networking can prevent forward moving progress and have the potential to exhaust the cooperative thread pool and under utilize the CPU. It's been recommended to offload these tasks from the cooperative thread pool. Is my understanding correct that the preferred way to do this is by creating async tasks via Dispatch or OperationQueue? And combining these with Continuations if a return value from the task is required? Or should I always be using Continuations in combination with Dispatch/OperationQueue? There are also Executors but the documentation seems a bit limited on how to use these. The new TaskExecutor is also only available on the latest beta's. My question is basically what is the recommend way to offload a task? Thanks!
0
0
761
Jun ’24