Comments (3)
这是swig的封装的机制,查阅资料发现swig有宏定义支持不生成新线程回调:
%insert("runtime") %{ #define SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON #define SWIG_JAVA_NO_DETACH_CURRENT_THREAD %}
但经过群友测试反馈发现并不好,有时线程增长剧烈也无法释放。而且这样线程的生成和释放在一般高频下也够用,不需要考虑这个的延时。真正的高频建议还是直接用c++。
当然,如果发现有别的更好的方法能解决这个问题,欢迎讨论。
from java-ctpapi.
我之前也发现了每次回调使用新线程的问题。这个似乎是无解的,因为回调是由jni调用的,每次会new一个线程,还没找到怎么能让jni回调使用线程池的方法。jvm会回收生命周期结束的线程实例,不用担心这个问题导致jvm堆溢出,性能肯定是有影响的,但一般量化足够用,做高频不用考虑jni调用。
from java-ctpapi.
找到了一个解决办法,还没测试过,供大家参考。https://www.cnblogs.com/bjguanmu/p/12582258.html
from java-ctpapi.
Related Issues (11)
- 行情价格多出小数部分 HOT 1
- makefile
- 查询结算单会丢失部分数据 HOT 6
- 请问能否CTP官方是已经更新到6.3.19了吗,本API是否会同步更新,谢谢了 HOT 2
- 结算单返回 conten 为null HOT 2
- 6.5.1的版本也是兼容的吗? HOT 4
- 穿透测试采集信息不全怎么办? HOT 1
- Demo启动即报错 java.lang.NoSuchMethodError HOT 2
- Aborted (core dumped) 问题
- 打jar包失败
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-ctpapi.