Main Content

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

백그라운드 처리

코드를 백그라운드에서 실행하면서 동시에 다른 코드도 실행

MATLAB®에서 코드를 실행할 경우 이 코드의 실행이 끝날 때까지 기다려야 다른 코드를 실행할 수 있습니다. 백그라운드 풀을 사용하면 코드를 백그라운드에서 실행하면서 동시에 다른 코드도 실행할 수 있습니다. 예를 들어, 백그라운드에서 계산을 수행하는 동안 반응성을 유지하는 앱을 만들 수 있습니다.

함수를 백그라운드에서 실행하려면 백그라운드 풀을 지정하여 parfeval을 사용합니다. parfeval은 백그라운드에서 실행되는 함수를 나타내는 Future 객체를 즉시 반환합니다. Future에서 결과를 가져오려면 fetchOutputs를 호출합니다.

함수

모두 확장

parfeval백그라운드에서 함수 실행
backgroundPoolEnvironment for running code in the background (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 (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

도움말 항목

백그라운드 처리 시작하기

응용 사례