-
Notifications
You must be signed in to change notification settings - Fork 523
Node节点是否线程安全? #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
贴具体的代码看一下,没太懂你的意思 |
例如com.alibaba.cloud.ai.graph.node.QuestionClassifierNode public static class Builder {
内部字段可变且无同步, 如果两个线程同时调用同一个 Builder 实例的链式方法并紧接着 build(),我理解可能拿到部分被另一个线程覆盖的字段值 |
不同线程都是new 的QuestionClassifierNode |
|
你这说的其实还是stategraph创建时共用一个overallstate的问题,针对这个情况,你可以在http每次调用new新的stategraoh跟overallstate就可以解决这个问题,这个跟#727 里面说的是一样的,727issue里面说的其实也可以通过我这种方式解决,不过这种解决方案会频繁创建对象,因此不太推荐 |
类似OverAllState, com.alibaba.cloud.ai.graph.node下的node, 在多线程同时调用同一个 Builder 实例时, 是否也有线程安全问题?
The text was updated successfully, but these errors were encountered: