|
![]() |
Originally posted by Anna Kafei:
Is there a need for locking a record when reading? I think reading is performed very frequently and locking is a big performance hit for a large DB (I know for the assignment, it won't be too big). But if I don't lock it, the record it is reading might be modifying by another thread at the same time. Any suggestions how to overcome this issue???
Oh when I say locking, I mean block synchronizing inside the read(). Not lock(); read(); unlock; Thanks for any advice!
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Originally posted by Jacques Bosch:
That is right. Only one i/o operation can be done at any one time. But trust me, for this assignment's scope, that performs just great, and keeps things simple!
According to my opinion anyway!
![]()
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Only one i/o operation can be done at any one time.
Is there a need for locking a record when reading? I think reading is performed very frequently and locking is a big performance hit for a large DB (I know for the assignment, it won't be too big). But if I don't lock it, the record it is reading might be modifying by another thread at the same time. Any suggestions how to overcome this issue???
Oh when I say locking, I mean block synchronizing inside the read(). Not lock(); read(); unlock; Thanks for any advice!
So do you think it has a potential reading partially modified data??? I think so, cos there are different instance of raf.
So should I make the raf static? If this is so, then I dont see why we need lock cookie since we just lock the static raf object instead.
Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available.
Everybody's invited. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|