Skip to content

About adding a pthread libraryΒ #45

@bucanero

Description

@bucanero

While trying to update/build some libraries like cURL, I saw that we don't have a pthread library and we need to rely on a --disable-thread option (if available).

Looking around, I saw that in the PSP/Vita homebrew sdk they built a pthread library, based on pthread-win32:
https://github.com/vitasdk/pthread-embedded

Could be possible to port this library to the PS3? from what I could check on the source code, they're building wrappers around the Mutex, Semaphores, and Threads from the SCE sdk, to offer a pthread interface.
In Psl1ght we do have access to the mutex, sems and threads too, so I think this would be a possibility, right?

If anyone with proper knowledge of pthread, threads, mutex, and semaphores could look into it, I'll be happy to help. πŸ˜„
My knowledge is limited in this topic (I haven't done any mutex/sem/thread stuff since college), and I don't want to just replace code lines blind, but I feel it could be a nice addition.

From my quick check on /platform/psp/psp_osal.c, we would need to change with proper PS3 calls:

sceKernelGetThreadId
sceKernelCreateSema
sceKernelCreateThread
sceKernelStartThread
sceKernelDeleteSema
sceKernelDeleteThread
sceKernelExitDeleteThread
sceKernelExitThread
SceKernelThreadRunStatus
sceKernelReferThreadRunStatus
sceKernelReferSemaStatus
sceKernelDelayThread
sceKernelReferThreadStatus
sceKernelChangeThreadPriority
sceKernelSignalSema
sceKernelWaitSema

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions