Skip to content
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

如何保证资源被清理,不会内存泄漏? #160

Closed
oldbig opened this issue Dec 21, 2019 · 2 comments
Closed

如何保证资源被清理,不会内存泄漏? #160

oldbig opened this issue Dec 21, 2019 · 2 comments
Assignees
Labels
duplicate ❓question Further information is requested

Comments

@oldbig
Copy link

oldbig commented Dec 21, 2019

当前线程设置的一个值,在子线程,子子线程,孨线程中都可以访问到。

当创建很多复杂的子线程时,如何能在所有子线程中清理掉 remove() 那些值?
是需要找到所有子线程依次调用 remove清理吗?还是这个已经实现了无需自己手动清理?

谢谢!

@oldratlee oldratlee self-assigned this Dec 21, 2019
@oldratlee oldratlee added duplicate ❓question Further information is requested labels Dec 21, 2019
@oldratlee
Copy link
Member

oldratlee commented Dec 21, 2019

问题重复。参见已有Issue中的说明:


是需要找到所有子线程依次调用 remove清理吗?还是这个已经实现了无需自己手动清理?

@oldbig
简单地说,TTL传递(capture/replay/restore)中的 restore 做了恢复,
即在任务执行完成后,会自动清除带过来的上下文。

进一步系统理解或确认,请看

@oldbig
Copy link
Author

oldbig commented Dec 22, 2019

谢谢 @oldratlee !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate ❓question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants