If anybody can understand fully the concept shared by all the videos in this Defog Tech channel, I bet he/she will get a package of 20+ LPA. Thank you for putting so many quality Java tutorial videos.
@shellindebted53286 жыл бұрын
Sir, i feel fortunate that i came across this video.I thoroughly enjoyed it. Thanks !
@smartstack2 жыл бұрын
Love your explainations! Have been binge watching!
@rajeevkandpal18803 жыл бұрын
Thanks again for explaining complex subjects with lucid simplicity. Please make a video on countdown latch/cyclic barrier and Phaser. thanks
@virtexamit6 жыл бұрын
Please do cover difference between LinkedBlockingQueue and ArrayBlockingQueue. Your explanation is very nice. Many thanks for such creative work and appreciated for sharing with all.
@jaime72952 жыл бұрын
The items in one is stored as an array while the other as a linkedlist
@mr.bikashdeka71175 жыл бұрын
@Defog Tech Please explain all the internal implementation of all collection framework
@odilhonislomov89542 жыл бұрын
Thanks a lot
@theycallme_nightmaster3 жыл бұрын
Would it be a good idea to use this for collision detection in a game? For example if you only had a render() thread on each object you could use a Queue to block until a collision detection thread picks up the object to be rendered at the perfect time so that the collision detection is happening in the background for the next frame while the current frame gets rendered. Thanks for the video, very helpful!
@Gett372 жыл бұрын
Thank you my friend
@alex_stevens6 жыл бұрын
Great explanation
@stefanjankovic82534 жыл бұрын
You mentioned methods put() and take(). What if I use some loop and use offer() and element() for example? Are they thread safe? Is only take and put thread safe here?
@ShyamSunderReddy-t1s Жыл бұрын
superb sir
@MegaAnufriev6 жыл бұрын
Nice and clear tutorials! Like your channel.
@DefogTech6 жыл бұрын
Thank you!
@sharanyarai3786 жыл бұрын
Since you mentioned blocking queue is thread safe then how many producer/consumer thread can work @ same time? What is thread safety means here?
@DefogTech6 жыл бұрын
Thread safety means, in presence of multiple threads doing concurrent access, the days integrity of the queue is not compromised. Blocking Queue will ensure* only one thread gets the value and only one thread is able to put value at a time.. etc.
@vijaymishra42324 жыл бұрын
very nice explanation
@filipfolkesson38653 жыл бұрын
Here you say that the producer thread becomes blocked, but didn't we state in another video that if the blocking queue was full the rejectionhandler would act accordingly to the specifiec policy?
@tridipchakraborty899 ай бұрын
That was with respect to a Custom threadpool implemented using an array blocking queue, where if all the the threads were busy and max threadpool size is reached, it will reject new incoming tasks. The rejection handler will then act according to specific policy
@MrMikomi4 жыл бұрын
Very good thanks
@BhawaniSingh-jc7cw4 жыл бұрын
Great... Thanks
@Abhishekkumar-ri9wp5 жыл бұрын
nice explanation
@shellindebted53286 жыл бұрын
May i ask you to provide few use cases of Blocking/Synchronous Queue . it would be of great help.
@DefogTech6 жыл бұрын
BlockingQueue is typically used for any problem of type producer consumer (BTW it's also used within Executor service to store tasks). Synchronous queue can be used for rate limiting where in one thread will accept request only after handing off it's task to a worker thread... If worker thread is busy it will have to wait and cannot accept new requests (BTW its also used in Cached thread pool where each new task directly created new thread and task itself is not stored in queue)
@anandkulkarni21116 жыл бұрын
Syncronized pub sub where a message needs to be distributed in acknowledged manner by handshake from reciever
@TheRoxGo6 жыл бұрын
very good explanation! thanks
@DefogTech6 жыл бұрын
Thank you! I'm glad it helped
@360Legion6 жыл бұрын
Could you make a video of Linked and ArrayBlockingQueue
@DefogTech6 жыл бұрын
Sure, will add to the list, though might take a while. I have many in the queue
@DavisTibbz2 жыл бұрын
So this is equivalent to go channels
@kostasgkoutis8534 Жыл бұрын
Yeah, kind of, except that this queue can not buffer, can not signal to the readers that the queue is writer is done, no timout, etc. I would look to LinkedTransferQueue for more functionality.
@anandkulkarni21116 жыл бұрын
I just realized that synchrnous queue can be implemented using exchanger concurrency class producer thread sends data and recieves nothing at exchange method Consumer thread sends nothing and recieves data 🤔
@MrMikomi4 жыл бұрын
Was just wondering about the exchanger class myself
@kfliden5 жыл бұрын
How does it work if there are multiple producers and consumers?
@DefogTech5 жыл бұрын
If there are multiple producer threads, only 1 thread will be allowed to offer/put (which in turn will need to wait for a corresponding consumer thread for hand-off)... rest of the producer threads will wait for their chance (they will be in blocking/waiting state until they get their turn). The constructor allows a fairness boolean value which determines if the waiting producer threads are allowed in first-in-first-out order. Same flow for multiple simultaneous consumers.
@kfliden5 жыл бұрын
@@DefogTech Great, thanks for the explanation!
@suryanarayansubudhi94396 жыл бұрын
Please make video on concurrent collection..
@DefogTech6 жыл бұрын
Sure, which one?
@suryanarayansubudhi94396 жыл бұрын
@@DefogTech concurrent hashmap
@DefogTech6 жыл бұрын
Cool, will add it to the list
@kannadasans75645 жыл бұрын
When to use Synchronous Queue
@DefogTech5 жыл бұрын
Its used when 2 threads need to coordinate to hand-over a task/event. In CachedThreadPool its used to submit task (to create new thread). In practical scenarios I have not encountered much use for Synchronous Queue