Main Content

Background Processing

Run code in the background and run other code at the same time

When you run code in MATLAB®, you must wait for that code to finish running before you can run other code. The background pool enables you to run code in the background and run other code at the same time. For instance, you can create apps that remain responsive while performing calculations in the background.

Useparfevalwith the background pool to run a function in the background.parfevalimmediately returns aFutureobject that represents the function running in the background. To get results from theFuture, callfetchOutputs.

Functions

expand all

parfeval Run function in background
backgroundPool Environment for running code in the background
fetchOutputs Retrieve results from function running in the background
afterEach Run function after each function finishes running in the background
afterAll Run function after all functions finish running in the background
取消 Stop function running in the background
取消All Stop all functions running in the background
wait Wait for futures to complete
fetchNext Retrieve next unread outputs fromFuturearray
Future Function scheduled to run
send Send data toDataQueueorPollableDataQueue
poll Retrieve data fromPollableDataQueue
afterEach Run function after data is received onDataQueue
parallel.pool.DataQueue Send and automatically process data
parallel.pool.PollableDataQueue Send and manually retrieve data

Topics

Get Started with Background Processing

Applications