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

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.

主站蜘蛛池模板: 类乌齐县| 嵩明县| 陆良县| 伊金霍洛旗| 福海县| 光泽县| 丹棱县| 邛崃市| 剑阁县| 天全县| 公安县| 潼关县| 漳平市| 富锦市| 海林市| 铜鼓县| 军事| 乌鲁木齐县| 青冈县| 德惠市| 洮南市| 鄂托克旗| 临城县| 拜城县| 英山县| 关岭| 七台河市| 灯塔市| 富平县| 蒲江县| 金坛市| 祥云县| 建阳市| 洪雅县| 阳原县| 岫岩| 扶绥县| 方城县| 大港区| 六盘水市| 理塘县|