Static field in struct and ID generation

Thank you for your suggestion. I'm trying to using it, but I got some trouble related to another topic, anyway I gave it a quick overview, but it looks a little complex to me, I was expecting something quite straightforward, but maybe this is the cost that you have to pay to assure thread safety for static mutable variables access.