### symmetric v.s. asymmetric coroutine

• the values of data local to a coroutine persist between successive calls
• the execution of a coroutine is suspended as control leaves it, only to carry on where it left off whe[……]

继续阅读

### Delimited Continuations

Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops, they allow to deviate from a sequential flow of control.

We use exception handling as another example for control flow ma[……]

## no matter how/wh-

no matter后面必须跟how, what, where, when, if, whether。

## regardless

regardless必须跟of。它跟no matter how/wh-一样，必须跟一个总结性的名词。

The club welcomes all new members regardless of age.
He went ahead and did it, regardless of the consequences.

## whether

[……]

### GIMP制作签名

filter -> render -> plasma (Turbulence=1 default value)

color -> desaturate -> color to gray

Choose paint brush (not pencil because hardness doesn’t apply to pencil)

Curve:

black: r,g,b to one tick, v to 7

blue: r,g to one tick, v to 3[……]

### 用时间表示距离

It’s a three-hour drive to London.

three-hour是drive的形容词，所以加hypen。

The station is (a few minutes’ walk) away from here.[……]

### 学校英语

I’m a PhD student in the CS program.

I’m a Master student in the CS program.

I study for a PhD degree in CS. 注意这里不用’s。

I study for a Master’s (degree) in CS. https://ell.stackexchange.com/a/267699/65098

I read for a Master’s degree in CS.

I read for a MSc degree in CS.

I study for[……]

### stackless coroutine的实现方式

callback

https://peps.python.org/pep-0255/

continuation passing style (CPS)

state machine

generators are used to easily create iterators; coroutines are used to introduce concurrency or complex control flows. https://faculty.ai/tech-blog/flow-types-for-generators-and-coroutines-in-ja[……]

### Multithreading code run by CPython with GIL and IronPython without GIL

CPython has a global interpreter lock such that two threads cannot run simultaneously on a multi-core CPU. The context switch (thread switch) duration, by default, is 0.05 second, which means a thread runs up to 0.05 second and then the execution switches to another thread.

from threading import[......]继续阅读

### stackful v.s. stackless coroutine

counterStyles[“fig”] = {locale:”en-US”}

coroutine （协程）是一般function的泛化。一般function一旦开始运行，就必须运行到return（或抛出异常）。coroutine除了可以开始运行和return，还能在中间的某个地方休息一会儿，歇完了能在刚才停下的地方继续运行。coroutine在执行时中间暂停的能力，一般实现为yield关键字。