Simple Virtual Machine
A simple but flexible virtual machine
SVM memory synchronisation

This module contains API functions to handle SVM memory synchronisation. More...

Functions

SVM_FUNCTION void svm_memory_synchronisation_enable (const void *svm, const SVM_Kernel kernel, const SVM_Value_Pointer pointer)
 This function enables the synchronisation on a memory zone. More...
 
SVM_FUNCTION void svm_memory_synchronisation_disable (const void *svm, const SVM_Kernel kernel, const SVM_Value_Pointer pointer)
 This function disables the synchronisation on a memory zone. More...
 

Detailed Description

This module contains API functions to handle SVM memory synchronisation.

Function Documentation

◆ svm_memory_synchronisation_disable()

SVM_FUNCTION void svm_memory_synchronisation_disable ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Pointer  pointer 
)

This function disables the synchronisation on a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]pointerThe memory zone to release from protection by synchronisation.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_process_ownership_lock
svm_kernel_get_current
svm_memory_share
svm_lock_new
svm_lock_readguard_new
svm_lock_writeguard_new

◆ svm_memory_synchronisation_enable()

SVM_FUNCTION void svm_memory_synchronisation_enable ( const void *  svm,
const SVM_Kernel  kernel,
const SVM_Value_Pointer  pointer 
)

This function enables the synchronisation on a memory zone.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]kernelThe kernel in which the targeted memory is.
[in]pointerThe memory zone to protect by synchronisation.
Note
The synchronisation applies to access to the memory itself, and not access to the value itself. If the value needs access synchronisation, it shall be done manually.

The synchronisation mechanism applied to each address of the memory zone is equivalent to SVM_Lock.

  • When a read to the memory is done from a synchronised address, a read lock acquisition is done,
  • When a write or deletion of the memory is done on a synchronised address, a write lock acquisition is done.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the kernel is not owned by our process or is not in a process locked by ours.
See also
svm_process_ownership_lock
svm_kernel_get_current
svm_lock_new
svm_lock_readguard_new
svm_lock_writeguard_new