Comments (3)
此功能需要从一开始设计的时候考虑进去,比如对各种算法调用的同时,需要判断是否so已经加载
from tongsuo-mini.
DSO实现大概有两种方式,一种借助OS提供的系统调用直接加载链接库(如Linux中的,dlopen/dlsym/dlclose,Windows中的LoadLibraryExW等接口),一种类似于apache自己实现一套接口(apr_dso_load/apr_dso_unload/apr_dso_sym/apr_dso_error,共四个接口),对不同的OS环境进行解耦。
需要划定一下目标OS环境,是否只是Linux系统,如果要支持其他嵌入式OS,则需要添加如apache的中间层。
但为后续扩展性计,此处宜直接做好解耦工作,建议采用Apache的中间层方式,只是一层对系统调用的封装,对性能几乎无影响。接口的语义上可直接参考Apache的四个接口,相关的预检工作也可在这层抽象中做文章。
关于Apache的具体做法参考:
接口定义:https://apr.apache.org/docs/apr/trunk/group__apr__dso.html
具体实现:https://github.com/apache/apr/tree/trunk/dso 在不同的目标OS中,对四个接口分别进行了syscall的映射。
应用实例:https://github.com/apache/apr/blob/trunk/test/testdso.c
from tongsuo-mini.
目前看来还是加一层比较合理
from tongsuo-mini.
Related Issues (20)
- SM2非对称加解密算法
- PEM文件转码为DER
- 解码SM2私钥PrivateKeyInfo结构
- 解码SM2公钥SubjectPublicKeyInfo结构
- Support X.509 Cert
- TLCP API设计
- TLCP Stack/State Machine
- Verification of Certificate Chain HOT 1
- ASN.1 Encode HOT 1
- Elliptic Curve Arithmetic
- Big Number HOT 1
- 内存统一管理
- Error and Debug API HOT 1
- 项目持续集成方案及实现 HOT 3
- Software PRNG
- 支持Ascon AEAD
- 支持Ascon Hash
- HKDF算法
- readme error
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 tongsuo-mini.