문제

Need to create a multiple user application in java with multiple insert at a time so i tried to maintain a queue using synchronized (this) in my program but it is not up to the mark. which will be the better option than synchronized. any help in this will be appreciated.

도움이 되었습니까?

해결책

How about maybe using Semaphores? They're really nice when you need to give access to more than one thread. I don't really know a lot, just what I've learned in class. Hope It'll help!

Here's a link to an example info on semaphores

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top