Andy-Python-Programmer / aero

Aero is a new modern, experimental, UNIX-like operating system following the monolithic kernel design. Supporting modern PC features such as long mode, 5-level paging, and SMP (multicore), to name a few.
https://aero.andypy.dev
GNU General Public License v3.0
1.17k stars 50 forks source link

Fast IPC #42

Closed Andy-Python-Programmer closed 2 years ago

Andy-Python-Programmer commented 2 years ago

Inter Process Communication should be fast and effective. The performance of IPC is vital for modern operating systems. Here is an overview of how we can accomplish this in Aero:

  1. Each task will have its own message queue that contains pending messages.
  2. The message will contain the sender's PID and TID with data (&[u8]). It will aswell contain a message ID (usize) used to identify the message without needing to parse the message itself.
  3. Using the sys_ipc_send and sys_ipc_get system calls the tasks can communicate with each other efficiently.

Drawbacks

This would require the kernel to clone the message 2 times (when you send the message the kernel keeps a copy of the message and for the task that we are sending to has to clone it again)

RaidTheWeb commented 2 years ago

idea stolen, thank you good sir. But i will implement it in C so much better

Andy-Python-Programmer commented 2 years ago

C is not nice

RaidTheWeb commented 2 years ago

:( that's hurtful

pitust commented 2 years ago

you only need to clone once in my design - sys_sendmsg can block until a sys_recvmsg and copy directly from one to another.

also you totally ripped off my design (except mine was superior as it was in D)

pitust commented 2 years ago

idea stolen, thank you good sir. But i will implement it in C so much better

sorry, i came up with this idea and implemented it in D - which is even better than C.

RaidTheWeb commented 2 years ago

too bad, undoubtedlyslowipcâ„¢ is based on the quantum technology of spaceos.

YusufKhan-gamedev commented 2 years ago

C is not nice

rust code looks bad.

Let C code in! There is no objective reason not to use (good) C code!

Andy-Python-Programmer commented 2 years ago

Lets keep this issue on topic. Also its rust is not ugly, I think you need glasses.

Andy-Python-Programmer commented 2 years ago

We now have a working implementation of this concept in #47 :^)

48cf commented 2 years ago

We have recently merged an implementation of this by @pitust in #54 which superseded my #47, which solved this issue 🥳