MJay
Celery 본문
Coroutines are a general control structure whereby flow control is cooperatively passed between two different routines without returning.
The 'yield' statement in Python is a good example. It creates a coroutine. When the 'yield ' is encountered the current state of the function is saved and control is returned to the calling function. The calling function can then transfer execution back to the yielding function and its state will be restored to the point where the 'yield' was encountered and execution will continue.
Blocking" means that the caller waits until the callee finishes its processing. For instance, a "blocking read" from a socket waits until there is data to return; a "non-blocking" read does not, it just returns an indication (usually a count) of whether there was something read.
You hear the term mostly around APIs that access resources that don't necessarily require CPU attention -- I/O, for instance. You also hear it in multi-threading: A call from Thread A to Thread B might be designed to "block" (hold up Thread A) until Thread B achieves the relevant state to process or at least accept the request. (The most obvious example there being "join", which usually means "I, Thread A, want to wait until Thread B has terminated" -- you use that when exiting a multi-threaded program.)
'Cloud Computing' 카테고리의 다른 글
Celery 간단 요약 정리 1 (0) | 2017.04.09 |
---|---|
Condor-annes vs Celery (0) | 2017.04.02 |
TR-Spark (0) | 2017.03.29 |
서버 var/www/html (0) | 2017.03.18 |
Cloud Computing 이란 ( Coursera) (0) | 2017.02.18 |