官术网_书友最值得收藏!

Other applications

The example in this chapter is primarily useful for applications where data or tasks have to be handled in parallel. For the earlier mentioned use case of a GUI-based application with business logic and network-related features, the basic setup of a main application, which launches the required threads, would remain the same. However, instead of having each thread to be the same, each would be a completely different method.

For this type of application, the thread layout would look like this:

As the graphic shows, the main thread would launch the GUI, network, and business logic thread, with the latter communicating with the network thread to send and receive data. The business logic thread would also receive user input from the GUI thread, and send updates back to be displayed on the GUI.

主站蜘蛛池模板: 三穗县| 蛟河市| 邓州市| 沭阳县| 门头沟区| 高淳县| 怀宁县| 通许县| 通许县| 乐陵市| 蕲春县| 靖西县| 康定县| 铜梁县| 沂水县| 文成县| 繁峙县| 石门县| 沈阳市| 汝州市| 黎川县| 泊头市| 郴州市| 布拖县| 虹口区| 宁武县| 柏乡县| 霸州市| 武汉市| 平遥县| 攀枝花市| 旅游| 贺兰县| 霍山县| 改则县| 浮山县| 铁岭县| 始兴县| 西和县| 敦煌市| 南木林县|