Git Product home page Git Product logo

Comments (3)

InfoHunter avatar InfoHunter commented on June 21, 2024

此功能需要从一开始设计的时候考虑进去,比如对各种算法调用的同时,需要判断是否so已经加载

from tongsuo-mini.

chainsaid avatar chainsaid commented on June 21, 2024

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.

InfoHunter avatar InfoHunter commented on June 21, 2024

目前看来还是加一层比较合理

from tongsuo-mini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.