39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AFIO.hpp
|
|
Date: 2021-8-21
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::IO::FS
|
|
{
|
|
|
|
// WARNING: AURORA::IO::FS ASYNC IS NOT THREAD SAFE
|
|
// You can use the synchronization objects for the purpose of cross-thread synchronization
|
|
// However; IAsyncTransaction should not be accessed from differing threads.
|
|
|
|
AUKN_SHARED_API(OpenAsync, IAsyncFileStream, const AuString &path, EFileOpenMode openMode, bool directIO = false, EFileAdvisoryLockLevel lock = EFileAdvisoryLockLevel::eNoSafety);
|
|
|
|
/**
|
|
* Waits for at least one file IO event
|
|
* @param transactions An array mask of FIO transactions
|
|
* @param timeout Timeout in milliseconds, zero = indefinite
|
|
*/
|
|
AUKN_SYM AuUInt32 WaitMultiple(const AuList<AuSPtr<IAsyncTransaction>> &transactions, AuUInt32 timeout);
|
|
|
|
/**
|
|
* A hint to dispatch any outstanding IO requests.
|
|
*
|
|
* The Aurora Runtime optimizes file FileRead/Writes by batching on some platforms.
|
|
* It may be required to call SendBatched for lower latency immediately after a Read/Write.
|
|
*
|
|
* Consider any call to WaitMultiple, internal loop source signal state, or loop queue wait,
|
|
* an internal hint to request an async IO work-queue flush.
|
|
*
|
|
* @warning This does nothing on NT
|
|
* @warning Linux StartRead/StartWrites will not start immediately. They instead wait for a yield or call to SendBatched.
|
|
*/
|
|
AUKN_SYM void SendBatched();
|
|
} |