Fast or fastest for data transfer between process?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
The Legend

Fast or fastest for data transfer between process?

Post by The Legend »

Hi,

I have a question for the pmode gurus out there.
What would be the best way to transfer a data block
from process A to process B? And can I implement
signals the best way? I don't want to poll in each
process ...

Thanks,
The Legend
J. Weeks

RE:Fast or fastest for data transfer between process?

Post by J. Weeks »

>On 2002-02-11 11:25:09, The Legend wrote:
>Hi,
>
>I have a question for the pmode gurus out there.
>What would be the best way to transfer a data block
>from process A to process B? And can I implement
>signals the best way? I don't want to poll in each
>process ...

I don't know if its the fastest way, but the easiest
would, no doubt, be to have a common memmory space
to all applications (or allow the allocation of
such a memory address) and get process A to copy
the memory to this common address, signal an event
to process B, which will then copy this data
into its space.

Problem is, if you've got many programs moving
memory from one to another, you'll have to wait
for each process to finish for the next to do
it (unless seperate "common" memory spaces are
used).

Don't know if that helps anyway, but that's probably
how I'd do it... Shouldn't be hard to switch to
another method if a better one exists, of course.

Jeff
Guest

RE:Fast or fastest for data transfer between process?

Post by Guest »

>On 2002-02-11 15:05:35, J. Weeks wrote:
>>On 2002-02-11 11:25:09, The Legend wrote:
>>Hi,
>>
>>I have a question for the pmode gurus out there.
>>What would be the best way to transfer a data block
>>from process A to process B? And can I implement
>>signals the best way? I don't want to poll in each
>>process ...
>
>I don't know if its the fastest way, but the easiest
>would, no doubt, be to have a common memmory space
>to all applications (or allow the allocation of
>such a memory address) and get process A to copy
>the memory to this common address, signal an event
>to process B, which will then copy this data
>into its space.
>
>Problem is, if you've got many programs moving
>memory from one to another, you'll have to wait
>for each process to finish for the next to do
>it (unless seperate "common" memory spaces are
>used).
Yes, it should be no problem if each process has
its own memory area in which it can receive the
data.

My problem still is that I don't have the slightest
idea how to send the signals ...

The Legend
J. Weeks

RE:Fast or fastest for data transfer between process?

Post by J. Weeks »

>My problem still is that I don't have the slightest
>idea how to send the signals ...

Well, that falls into the range of IPC (inter
process communication). Do a search for that
and see what you come up with ('cuz I'm not a
good one to ask about IPC :)

The way _I_ would do it, however, would be, again,
with common memmory (you'll have to have some
form of common process memory).

You wanna send a message, just write to that
common memory (with a destination address, or
whatever), or you can call an OS function which
will then maintain a list of current events to
be sent to processes.

Actually signalling to the other program that its
received an event could be done in many ways.

The application could tell the OS to call a certain
function when it receives and event. At which
point your OS is going to have to have a storage
space for pointed to these functions for every
process running, and must also continually check
this shared memory address to see if anything's there.

Secondly, your destination process can continually '
probe this common memory space itself.

I know this I'm not phrasing this too well.
In essence, you're OS has to have a mechanism
to receive events, and send them to processes.
Your processes will then have to have a mechanism
to receive (or probe) for messages.

There's nothing really mystical about it... app
A tells the OS it wants to send a message, the
OS keeps the message in a queue, app B checks for
messages, and grabs it from the OS.

The mechanics of it are up to you. Check out the
X11 event model... that's one way to do it.

Sorry I couldn't be of more help
Jeff
Guest

RE:Fast or fastest for data transfer between process?

Post by Guest »

>On 2002-02-12 11:41:38, J. Weeks wrote:
>>My problem still is that I don't have the slightest
>>idea how to send the signals ...
>
>Well, that falls into the range of IPC (inter
>process communication). Do a search for that
>and see what you come up with ('cuz I'm not a
>good one to ask about IPC :)
>
>The way _I_ would do it, however, would be, again,
>with common memmory (you'll have to have some
>form of common process memory).
>
>You wanna send a message, just write to that
>common memory (with a destination address, or
>whatever), or you can call an OS function which
>will then maintain a list of current events to
>be sent to processes.
>
>Actually signalling to the other program that its
>received an event could be done in many ways.
>
>The application could tell the OS to call a certain
>function when it receives and event. At which
>point your OS is going to have to have a storage
>space for pointed to these functions for every
>process running, and must also continually check
>this shared memory address to see if anything's there.
>
>Secondly, your destination process can continually '
>probe this common memory space itself.
>
>I know this I'm not phrasing this too well.
>In essence, you're OS has to have a mechanism
>to receive events, and send them to processes.
>Your processes will then have to have a mechanism
>to receive (or probe) for messages.
>
>There's nothing really mystical about it... app
>A tells the OS it wants to send a message, the
>OS keeps the message in a queue, app B checks for
>messages, and grabs it from the OS.
>
>The mechanics of it are up to you. Check out the
>X11 event model... that's one way to do it.
>
>Sorry I couldn't be of more help
>Jeff
No problem.

The reason why I am asking it here, is that I
don't find many good tutorials or docs about OS development.
Most tell you how to enter pmode and output "Hello world"
and then you are alone.

I want to avoid polling, as I wanted to use IPC
for my COM/Corba-like object model, even for the
drivers, but your idea that the applications should
have some callable functions seems good.
Seems like I had a black-out while opening this
thread ...

Okay, write to a common memory location and call
the application's "incoming event" function!
(and later some more internal stuff, basically
it will be a remote function call, if app A calls
app B the scheduler should give all cpu-power for
app A to app B, but that are details how to get this
system working smoothly ...)

The Legend
Post Reply