-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pleaseee add the maven-compiler-plugin #7
Comments
This problem is specific to Eclipse (which I don't use so I never noticed.) The least intrusive solution would be to add:
|
Oops that is what I added in my comment above:), it was lost due to improper markup, sorry. |
Testing this library to force different JVM threads to go into wait state by acquiring read locks while only one thread acquires a write lock to write to cache. All of them start by attempting to acquire a write lock using lock.writeLock().tryLock(5 * LONG_DELAY_MS, TimeUnit.MILLISECONDS) but only one succeeds. Is there an option to acquire writeLock and return quickly if lock is acquired and return quickly if lock is already acquired by another thread without specifying any delay? |
If you mean is tryLock() supported (no timeout version), the answer is no. On Wed, Apr 22, 2015 at 4:33 PM, krishna81m [email protected]
|
There are a bunch of threads in "different JVMs" trying to do the same operation and cache the result for other threads. We are trying to make threads wait until a specific single thread makes the cache entry. Although cache operations themselves are Atomic, the calculation is expensive! If locking is fairly cheaper and faster, the smaller time to acquire lock will compensate for many expensive operations by other threads as one thread should suffice to do the job. |
Off the top of my head (sorry, not much time to think about this), it sounds like something that an ICondition would be useful for. All threads acquire a lock and then wait on a particular condition. One thread should succeed right away and the others will awake when condition.signalAll() is called by the first thread. You'll have to be careful with what happens once those threads have been woken up, but that's well-known sort of stuff wrt Object.wait() and notifyAll(). |
Hmm, how different is this from reentrant writeLock() and readLock() wait pattern? I completed development and started testing following changes:
|
Noticed that write locks are not satisfying the lock wait time, when I chose a 20 ms time out, I can see at least 100-200 ms which is not good. What I noticed was that while most of them were under 20, there were quite a bit taking very large times. Some taking almost 10s :(
Here is a histogram of a small sample: < 100.00 70034 91.70 (hidden to show how values only above 100ms) |
Was trying to break my head why Eclipse (soon EOL with IntelliJ) kept complaining even when I noticed that properties set.
Only to find hours later that the plugin itself was missing.
The text was updated successfully, but these errors were encountered: