Open SchrodingerZhu opened 3 years ago
Right, I will add documentation on this. The multi-prompt api is not doing any locking and leaves it up to the programmer. It is generally not safe to resume a resumption from another thread for 2 reasons:
So, generally one must be very careful to migrate resumptions between threads. It is possible though in principle if the right guarantees are given, in particular if it is used from the outermost handler (for example, this would be the case for asynchronous I/O or a green-threading library)
It seems that the prompt will violate same-thread-lock, same-thread-release rule in some case. (Consider a thread pool to execute multiple prompts). I dont know whether it is my fault so I open this to ask whether the library support that usage currently.