Main Content

La traduzione di questa pagina non è aggiornata. Fai clic qui per vedere l'ultima versione in inglese.

Elaborazione in background

Eseguire il codice in background ed eseguire contemporaneamente un altro codice

Quando si esegue del codice in MATLAB®, è necessario attendere che il codice finisca di essere eseguito prima di poterne eseguire un altro. Il pool in background consente di eseguire codice in background e di eseguire contemporaneamente altro codice. Ad esempio, è possibile creare applicazioni che rimangono reattive mentre si eseguono calcoli in background.

Utilizzare parfeval con il pool in background per eseguire una funzione in background. parfeval restituisce immediatamente un oggetto Future che rappresenta la funzione in esecuzione in background. Per ottenere i risultati da Future, chiamare fetchOutputs.

Funzioni

espandi tutto

parfevalRun function in background
backgroundPoolEnvironment for running code in the background (Da R2021b)
fetchOutputsRetrieve results from function running in the background
afterEachRun function after each function finishes running in the background
afterAllRun function after all functions finish running in the background
cancelStop function running in the background
cancelAllStop all functions running in the background (Da R2022a)
waitWait for futures to complete
fetchNextRetrieve next unread outputs from Future array
FutureFunction scheduled to run
sendSend data to DataQueue or PollableDataQueue
pollRetrieve data from PollableDataQueue
afterEachRun function after data is received on DataQueue
parallel.pool.DataQueueSend and automatically process data
parallel.pool.PollableDataQueueSend and manually retrieve data

Argomenti

Come iniziare con l’elaborazione in background

Applicazioni