SCJP 1.2 Done<br />SCJD 1.4 (URLyBird 1.2.1) (In Progress)
MCP (C# application dev 70-316) 860<br />SCJP 1.4 100% SCJD (URLyBird) 378<br />MAD 100% nuts
Originally posted by Nikolay Petrov:
Hi All,
1. Should we support dirty reads. This means that in some cases read record could be executed simultainiously with update/delete and therefore the client will receive wrong data. The cure for this could be to make read/update/delete methods synchronized and thus not allowing records to be read/modified simultainiously (I have separate record object which hadles these, and there is not worry when read/modify different records)
SCJP 1.4, SCJD
SCJP 1.2 Done<br />SCJD 1.4 (URLyBird 1.2.1) (In Progress)
SCJP 1.2 Done<br />SCJD 1.4 (URLyBird 1.2.1) (In Progress)
Originally posted by Nikolay Petrov:
After a little brainstorming on this I came up with idea of read/write lock(gate). As I picture it this means that I have an object with following methods:
<CODE>
lockRead
unlockRead
lockWrite
unlockWrite
</CODE>
I target here the following things:
1. When you perform lockRead all lockReads are passing, but lockWrite is waiting until unlockReads are executed.
2. When you perform lockWrite all other threads should wait until unlockWrite is executed (this includes all lockReads and lockWrites).
SCJP 1.2 Done<br />SCJD 1.4 (URLyBird 1.2.1) (In Progress)
Originally posted by Nikolay Petrov:
I know this package very well. But I'm not sure is it ok to use it in my assignment and that is why I don't. On the other hand until you know how to make something I don't advise using it. I mean that even if the package is there I must know how its working.
You could also use synchronized on you record storage. I mean all operations like find/delete could be placed inside synchronized block.
Use of functionality provided by the core Java classes will be preferred to your own implementation of that functionality, unless there is a specific advantage to providing your own implementation.