Does anyone know how to have a thread randomly decide if it wants to do blocking or non-blocking mode with direct communication? I am using a bounded buffer with size of 5. I have the non-blocking mode right but I am not sure how exactly to change it to accommodate for blocking mode. I am not very proficient with Java. I am actually just learning. Does anyone also know how to do blocking direct communication with only 1 producer and 1 consumer used for blocking and non-blocking? Thanks for any help anyone may have.

Hi everyone,

It depends on the format of your data packets. You could create your own format for data packets. One more thing your buffer size is 5 what? integer, double, etc.

Richard West

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.