PG has a special memory manage rule, named MemoryContext.
All memory allocated in a context will disappear when it leaves that context. this means that you can safely not free memory, or your memory will be freed in unexpected places. this is a big conflict with the way rust manages memory. write extension in rust won't improve it much.
And in PG, there is a special method to create a process, creating threads is not possible because the logging system makes heavy use of setjmp().