Re: Share a semaphore between process and a kernel task.
Re: Share a semaphore between process and a kernel task.
- Subject: Re: Share a semaphore between process and a kernel task.
- From: Inso Reiges <email@hidden>
- Date: Tue, 03 May 2011 10:45:27 +0700
Michael,
I am not sure yet what i am trying to do :) I am exploring possibilities.
The major task at hand is as follows. I have an IOService in kernel
that stores encryption keys and services crypto requests. Don't ask
why crypto is in kernel - this is something i can't currently change.
There is a large chunk of work that can be precomputed if several
requests use the same encryption key (encryption key extension). I
want to create a persistent kernel service that precomputes this chunk
of work on initialization, shares a memory page with a user process, a
mach port and a semaphore. The plan is for user process to initialize
this kernel object with a single key then for all further requests put
the data to encrypt or decrypt in the shared memory, send a message
through mach port and block on the semaphore while kernel processes
the data from the shared memory. After completion kernel wakes the
user process through the semaphore. The user process then takes
encrypted/decrypted data from the same shared memory buffer.
This is how similar functionality was implemented on Windows and i was
hoping to directly port the same idea on OS X.
If there is a better way to do this i would be glad to know.
Thanks.
Inso Reiges
On Sat, Apr 30, 2011 at 10:04 AM, Michael Smith <email@hidden> wrote:
>
> On Apr 29, 2011, at 6:13 AM, Inso Reiges wrote:
>
> Can i share a semaphore between a user space process and a kernel
> task? If yes, how can i do this?
>
> This is almost always the wrong thing to do. In general, the kernel
> services requests from user space, it does not compete on equal standing for
> resources with user space processes.
> What are you actually trying to do?
> = Mike
> --
> True terror is to wake up one morning and discover that your high school
> class is running the country. -- Kurt Vonnegut
>
>
>
>
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden