sceIoOpen and sceIoOpenAsync
Are there real differences? Or can this whole async stuff be emulated using non-async functions?
I'm asking this because apparently psp kernel is not reentrant, and when I call sceIoRead with a lot of bytes to read, syscalls from other threads (like reading psp joystick state) seem to block until reading from file is done. I though that maybe async i/o might be a solution for this.
sceIoOpen and sceIoOpenAsync
Did someone here use async file io?
I'm doing something like this:
Where to get the amount of bytes read after that? You'd think it would be in asyncres, but asyncres has the same values as f for some reason.
I'm doing something like this:
Code: Select all
SceUID f;
SceInt64 asyncres;
if((f=sceIoOpenAsync(path,PSP_O_RDONLY,0777))<0)
return NULL;
sceIoReadAsync(f,buffer,bufsize);
sceIoWaitAsync(f,&asyncres);
Shouldn't you wait also for sceIoOpenAsync completion?Noko wrote:Did someone here use async file io?
I'm doing something like this:Where to get the amount of bytes read after that? You'd think it would be in asyncres, but asyncres has the same values as f for some reason.Code: Select all
SceUID f; SceInt64 asyncres; if((f=sceIoOpenAsync(path,PSP_O_RDONLY,0777))<0) return NULL; sceIoReadAsync(f,buffer,bufsize); sceIoWaitAsync(f,&asyncres);
Even if openasync returns success and a valid fd, that doesn't mean it completed the opening.
Code: Select all
SceUID f;
SceInt64 asyncres;
if((f=sceIoOpenAsync(path,PSP_O_RDONLY,0777))<0)
return NULL;
sceIoWaitAsync(f, &asyncres);
if (asyncres < 0)
return NULL;
sceIoReadAsync(f,buffer,bufsize);
sceIoWaitAsync(f,&asyncres);