anchao commented on PR #17468: URL: https://github.com/apache/nuttx/pull/17468#issuecomment-3832940464
> > > > I won't let this submission be merged: > > > > > > > > 1. code size will increase. > > > > 2. performance will degrade. > > > > > > > > > without refcount, the used after free will happen under the stress testing of task/thread create/destroy. Used after free is a critical bug which must be fixed. refcount is one of well known method to fix this type of error, if you have better suggestion/method, please point out. > > > > > > > > 1. This is because in your business logic, Task A still holds the resources of Task B when it exits. Why can't the resources be released properly? > > 2. Most IoT and wearable devices use a fixed thread pool. If your business process involves the frequent creation and destruction of a large number of threads, why not design them as deterministic tasks and implement the creation and exit logic with wait/notify mechanisms? > > No, I just consider POSIX spec, not private business logic. POSIX spec allow appliation create/destroy task/thread dynamically, we need fix the problem. Let's hightlight the inviolable rule here: https://github.com/apache/nuttx/blob/master/INVIOLABLES.md#strict-posix-compliance > > > 3. The only acceptable solution to me is to make this feature configurable via Kconfig – no other options are on the table. > > it's bug fix, I don't unerstand why we add an option to choice whether to fix a critical(memory corruption) bug. But this is not a bug on my end. There is no scenario in my commercial solution where threads are dynamically created or deleted. If you insist on merging this commit, make it configurable—this way it won’t block existing users. This is my final concession. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
