The boss told you not to clog up

Java multi-threading series of four.

Java multi-threaded continue our series of articles, then talk about the concept of today, this should be the last one basic concept, then go directly to the theme of the multi-threaded Java, later in the article, if there is need to come up with the concept alone is concerned to add the concept papers.

This article talk about blocking (Blocking) and non-blocking (Non-blocking) .

After first learning the skills necessary to work

In school project to do, basically independent development, the development of a part of everyone in order to minimize communication cost way to divide the workload. To the workplace, simply to minimize the cost to the organization of work butt is almost impossible factor to consider changed much, the various cross-group, inter-departmental, inter-even workplace work, which brings the cost of communication and work docking various blocking issues.

When the couple started going to the workplace, for all you are not familiar with, when docking in doing some outside group, you will encounter a variety of problems, especially now filled with a variety of distributed architecture, Web development before the background of the students should be developed JSP pages, while the front and rear end are now separated. Imagine this scenario.

Xiao Ming is learning the tip came from, just started to enter the workplace, the first requirement is to make login and registration interface, you need to write a docking background colleague Xiaodong, Xiaodong responsible for the development and the logic behind login registration. Xiao Ming has developed a login screen, ready and Xiaodong docking FBI login function, then Xiaodong replied that he just has a bug in the production follow-up, not a good development, Xiao Ming then how to do?

There are two approaches:

  1. Dry waiting Xiaodong develop good sign in the background, and then he and the FBI.

  2. Registration interface development, the development process time again ask Xiaodong Login Web interface is done, if Xiaodong done, go docking.

What is the key difference between these two kinds of approach is it? For Xiaodong, it lacks distinction, as soon as he can do is try to realize his function points. The main concern Xiao Ming, the first approach, Xiao Ming do the login screen, then wait Xiaodong login interface to the background, if you want to develop a Xiaodong afternoon, then an afternoon Xiao Ming would do nothing but shoot, this situation is blocked other tasks Xiao Ming's login screen because the FBI did not butt, but has been blocked with; the second approach, Xiao Ming learned Xiaodong Login Web interfaces not yet implemented, will begin registration interface functions do first, and then with every passing hour Xiaodong confirm Login Web interface development, whether developed, developing finished until Xiaodong Login Web interfaces, began docking the FBI, this is a non-blocking is not docked FBI does not affect the development progress Xiaoming, the login screen can be linked when he transferred the FBI, the FBI was unable to complete the other tasks at hand.

Some students may be entering the workplace will be guilty of such errors, do function dependent on others, because others have not done, then using the first approach, has been waiting to dry, and then continue to work until the completion of the other party. Occasionally sneaking lazy okay, if this kind of work has been the state is not good for students entering the workplace, and this is very bad boss know. If a demand for a blocking point, and we should do first work on the other hand, if no other work on hand, just like the boss lead after feedback from other tasks to do, but also time to follow up the progress of demand point of obstruction.

This is described below with a flowchart two concepts:

Clog

Clog

Non-blocking

Non-blocking

Read the above chart, it is not blocking and non-blocking more understanding of it?

Boss have the final say

If you are the boss, or is the leadership of Xiao Ming, Xiao Ming how do you make? The first approach or second approach it? The first approach that supports the trouble to contact me, you also recruit people it?

推荐阅读

Eating fast food can learn serial, parallel, concurrent

A cup of tea, a school with asynchronous learn

Process Know?

Design Patterns looked forgot, and forgot to look at?

Background reply "design mode" can get "a story of a design pattern" eBook

觉得文章有用帮忙转发&点赞,多谢朋友们!

Lieb Rother

Guess you like

Origin www.cnblogs.com/liebrother/p/11318906.html