17.03.2014 12:30, Alex Peshkoff wrote:
> On 03/17/14 15:01, Dimitry Sibiryakov wrote:
>>      There is no such risk from the beginning because y-valve is single 
>> threaded as every
>> call is protected with mutex.
>
> May be old API :)

   No, old API works the same way.

>>    Besides, storing reference to object already increment its
>> usage counter, so nobody can free the object during wrapper's life time.
>
> But using something like commit for transaction can nullify next pointer.

   No, it just free local copy of pointer and decrease reference counter. All 
other 
pointers will survive, they will point to finished and may be invalid 
transaction, but a 
valid object.

>>      Besides, such copying inside of routine just don't work because another 
>> thread can
>> nullify the pointer between entering into routine and copying.
>
> Yes.
> Therefore pointer to next object is first copied to local reference
> pointer and analyzed only after it.

   No fast enough. To be thread safe it must be assigned to reference pointer 
before 
function call.

>>      Not all people has the same IQ and knowledge. I don't see any comment 
>> about meaning of
>> the word "next" in method names
>
> next means next level's interface pointer
> what needs more comments here?

   Here - nothing. But in code there is no even "next level's interface 
pointer".

> I can't explain here any more in plain english - it's already much
> better described in c++

   C++ describe what is doing. It can't answer the question "why" or "how 
drunken was 
developer when typed this spaghetti".

   Besides "description" like this is not really helpful and don't answer 
question why 
entry.next() is used for calls instead of plain next. From the following is 
clear that 
next() just return next and do nothing more (except may be producing SEGFAULT 
when it 
return NULL).

        aStatus->init();
        init(object->next);

        if (checkAttachment && !(nextRef.hasData()))
        {
                fini();
                Arg::Gds(Y::ERROR_CODE).raise();
        }

        if (checkAttachment && ref && ref->savedStatus.getError())
        {
                fini();
                
status_exception::raise(object->attachment->savedStatus.value());
        }

        typename Y::NextInterface* next()
        {
                return nextRef;
        }



-- 
   WBR, SD.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to