Closed hannesm closed 7 months ago
Hi, I'm not really aware about domains and multicore stuffs in Ocaml5, so I may be wrong here, but for the DES item, couldn't using the __thread
qualifier be ok? (I tried https://github.com/palainp/mirage-crypto/tree/des-thread and I can see that the .tbss
section is now present in bench/speed.exe
and, as we now we have .tbss
and .tdata
with solo5, it should works).
encrypt
/decrypt
)I'm not sure storing the keys in thread-local storage is a good path, as keys from different domains won't be shared :( Maybe using a mutex approach would be better?
I'm not sure storing the keys in thread-local storage is a good path, as keys from different domains won't be shared :( Maybe using a mutex approach would be better?
Using TLS was the first idea I had for continuing to use global buffers but not sharing them between domains. Currently the use of these global buffers is correct, even taking ocaml-tls
into account, and it is difficult to imagine encrypting/decrypting a source across several domains (on the other hand, this can be done concurrently, as with lwt
).
Using a mutex would have a very significant impact on performance.
uhm, hold on... maybe we can find some DES code that doesn't use global data (and has a public domain license)? Or modify the code that is part of mirage-crypto to get the key structures passed explicitly?
See #223 for DES without global state
Hi, I'm not really aware about domains and multicore stuffs in Ocaml5, so I may be wrong here, but for the DES item, couldn't using the
__thread
qualifier be ok? (I tried https://github.com/palainp/mirage-crypto/tree/des-thread and I can see that the.tbss
section is now present inbench/speed.exe
and, as we now we have.tbss
and.tdata
with solo5, it should works).
your const
stuff would be very welcome on top of #223 :)
Hi, I'm not really aware about domains and multicore stuffs in Ocaml5, so I may be wrong here, but for the DES item, couldn't using the
__thread
qualifier be ok? (I tried https://github.com/palainp/mirage-crypto/tree/des-thread and I can see that the.tbss
section is now present inbench/speed.exe
and, as we now we have.tbss
and.tdata
with solo5, it should works).your
const
stuff would be very welcome on top of #223 :)
nevermind, I'll pick those up and push to 223 :)
Thanks for the cherry picking work!
At the time being, there are two things to consider: