From: Adriano d. S. F. <adr...@gm...> - 2011-03-29 15:00:22
|
On 29-03-2011 10:45, Alex Peshkoff wrote: > We have too many problems in single thread. I try to divide it to > smaller parts. > The first one - here we at least all seem to talk about same thing:-) - > is to use reference counters or not. > > On 03/28/11 22:45, Adriano dos Santos Fernandes wrote: >> User should *not* request a detachment and then request actions on the >> objects. This *is* user application problem, no mater it being single or >> multi thread. > > In that case our new API is regression compared with old ISC API with > handles. Pre FB3 an attempt to request actions on the objects after > detachment cause correct reply from client library - invalid handle. > Without reference count support we will get segfault in FB3. I treat > this as serious regression. > You're trying to make two different worlds to look similar. Take another look at it. Thread 1 detachs and makes it handle invalid. Thread 2 allocs 0xFFFFFFFF handles. Thread 3 is scheduled to run and use the old invalid, but now valid handle. Very pessimistic and "impossible" to happen, but shows that application doing this with handles are still incorrect. You also didn't replied yet to me what will happen when you detach a parent without free children: leaks or will regret your refcounters? In anyway, it shows you're using an incorrect solution. > As one of users replied: Object-based interfaces should use the refcount. Against him is almost entire world who built API without refcount. Adriano |