Hello Giovanni,
I'd also really much like to see the mail method you described. Do you still plan on adding this? I have not seen it in the TODO.
Example of memory pool + struct + mailbox.
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example of memory pool + struct + mailbox.
Yes, it is planned, I just forgot to add it to the to-do list, probably I will give it a try later today.
What is really needed is just a special kind of memory pool where the allocation operation is guarded by a semaphore, probably it would be better give it a more generic name than "mail".
Giovanni
What is really needed is just a special kind of memory pool where the allocation operation is guarded by a semaphore, probably it would be better give it a more generic name than "mail".
Giovanni
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example of memory pool + struct + mailbox.
I added this "mail pool" handler to the repository, look under ./os/various, it is not tested yet but very simple.
I didn't add explicit send/receive functions, the normal mailbox functions can be used (mail goes into the mailbox after all
).
It is called "mail pool" but it is a generic pool of objects guarded by a semaphore, probably it will get a more generic name later and included in the kernel.
Giovanni
I didn't add explicit send/receive functions, the normal mailbox functions can be used (mail goes into the mailbox after all
It is called "mail pool" but it is a generic pool of objects guarded by a semaphore, probably it will get a more generic name later and included in the kernel.
Giovanni
Re: Example of memory pool + struct + mailbox.
Hi Giovanni,
I don't see this in current releases... was there some problems with using mail pools?
Or, did you implement them some other way?
I need a way to send intact messages to serial devices and I am looking at
using memory pools to hold my messages, then a "serial server" that retrieves
pool ids from a mail box and zips them out the serial port.
The messages will come from several threads at essentially random times.
I don't see this in current releases... was there some problems with using mail pools?
Or, did you implement them some other way?
I need a way to send intact messages to serial devices and I am looking at
using memory pools to hold my messages, then a "serial server" that retrieves
pool ids from a mail box and zips them out the serial port.
The messages will come from several threads at essentially random times.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example of memory pool + struct + mailbox.
Hi,
I removed that module from the distribution, you have to get it from some old repository revision (look the history of ./os/various).
You can do exactly the same thing using 2 mailboxes, one containing the unused objects and the other for sending them. It is like a 2-way communication.
Giovanni
I removed that module from the distribution, you have to get it from some old repository revision (look the history of ./os/various).
You can do exactly the same thing using 2 mailboxes, one containing the unused objects and the other for sending them. It is like a 2-way communication.
Giovanni