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

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.

主站蜘蛛池模板: 余庆县| 桃江县| 临朐县| 衡南县| 临泉县| 北票市| 彭阳县| 黔江区| 壤塘县| 九江县| 观塘区| 昭平县| 什邡市| 手游| 湘阴县| 镇远县| 富平县| 勃利县| 娄底市| 手游| 兴安县| 宽城| 孝义市| 集贤县| 兰西县| 宁夏| 辽源市| 友谊县| 民和| 比如县| 蓝山县| 靖安县| 盐山县| 肇州县| 临沧市| 大荔县| 新余市| 响水县| 延长县| 泗洪县| 六枝特区|