变形多个可执行到单个应用程序 [英] Morphing multiple executables into a single application

查看:282
本文介绍了变形多个可执行到单个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有分享了很多源$ C ​​$ c和三个数据的遗留应用程序。这些应用中的多个实例可以由用户在任何时间执行,例如十几混合应用程序的执行可以同时处于活动状态。这些应用程序目前通过共享内存和消息传递技术交流,使他们能够维护共同光标定位等,这些应用程序编写主要是在C ++中,使用Qt和共运行约500万code线。只有一些现有的code是线程安全的。

I have three legacy applications that share a lot of source code and data. Multiple instances of each of these applications be executed by a user at any time, e.g. a dozen mixed application executions can be active at a time. These applications currently communicate through shared memory and messaging techniques so that they can maintain common cursor positioning, etc. The applications are written primarily in C++, use Qt and run in total to about 5 million lines of code. Only some of the existing code is threadsafe.

我要整合这三个可执行文件到一个可执行文件,并使用多线程功能,使这三个功能分支的多个实例,在同一时间执行。有人建议我去考一些通过升压,例如,所提供的功能共享指针,并使用OpenMP的,以协调多个线程的整体执行。

I want to consolidate these three executables into a single executable and use multi-threading functionality to allow multiple instance of each of the three functionality branches to execute at the same time. It has been suggested that I look into some of the features provided by Boost, e.g. shared pointers, and use OpenMP to orchestrate overall execution of the multiple threads.

有关如何继续将AP preciated,在对付这种重构问题的最好办法特别引用任何意见。

Any comments on how to proceed will be appreciated, particularly references on the best way to tackle this kind of a refactoring problem.

推荐答案

我的建议,你会先设计所需的解决方案(先假设要求是一样的),然后建立从现有的$ C分阶段迁移路径$ C碱基使其基于第三方的功能可能引入的要求。

My suggestion to you would be design the desired solution first (firstly assuming that the requirements are the same) and then build a phased migration path from the existing code base basing it on the requirements that third party functionality may introduce.

重构应该是一次一小步 - 但我们知道你要去哪里

Refactoring should be one small step at a time - but knowing where you are going.

借助与传统code(罗伯特·马丁系列)有效运行将是一个良好的阅读我建议。

The Working Effectively with Legacy Code (Robert C. Martin Series) will be a good read I'd suggest.

相信我(我已经得到了T恤)不要试图重构,除非你知道如何证明的功能 - 自动验证测试将是你的救星

Trust me (I've got the t shirts) don't attempt to refactor unless you know how to prove functionality - automated verification tests will be your saviour.

这篇关于变形多个可执行到单个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆