OCaml Forge
Feature Requests
Search the entire project
This project's trackers
This project's tasks
This project's releases
This project's news
Project
People
Advanced search
Log In
New Account
Home
My Page
Projects
Code Snippets
Cryptokit: cryptographic primitives
Summary
Activity
Tracker
Lists
Tasks
News
SCM
Files
Detail: [#688] Support for Bigarray as well as string
Feature Requests: Browse
|
Download .csv
|
Monitor
[#688] Support for Bigarray as well as string
Date:
2010-07-22 13:24
Priority:
3
State:
Open
Submitted by:
Goswin Brederlow, von (
goswin
)
Assigned to:
Nobody (None)
Component:
None
Operating System:
None
Product:
None
Summary:
Support for Bigarray as well as string
Detailed description
The Bigarray module has several advantages over strings for use a buffer. The data in a bigarray is allocated outside the GC heap and will not be moved by the GC. This allows the data to be accessed within caml_enter/leave_blocking_section() without the need to copy it first. This allows a zero copy read()/write() or use of libaio for IO.
The same applies to e.g. computing a sha1 digest. It would be nice if one could use a Bigarray in place of the string. This would allow the sha1 function to run within caml_enter/leave_blocking_section() and in parallel with other threads.
For an example on how to do it see my Patch for the Digest module. You can probably copy the code straight from there with minimal adjusting:
http://caml.inria.fr/mantis/view.php?id=5005
MfG
Goswin
Followup
No Followups Have Been Posted
Attached Files:
Attachments:
0009-digest-rewrite.patch
Changes:
Field
Old Value
Date
By
File Added
72: 0009-digest-rewrite.patch
2010-07-22 13:42
gildor-admin