Sujet : Re: "White House to Developers: Using C or C++ Invites Cybersecurity Risks"
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : comp.lang.c++ comp.lang.cDate : 08. Mar 2024, 22:23:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <usfvld$1tfqm$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 3/6/2024 2:18 PM, Chris M. Thomasson wrote:
On 3/6/2024 2:43 AM, David Brown wrote:
[...]
This is a fun one:
// pseudo code...
_______________________
node*
node_pop()
{
// try per-thread lifo
// try shared distributed lifo
// try global region
// if all of those failed, return nullptr
}
void
node_push(
node* n
) {
// if n came from our per-thread, try to push it into it...
// if n came from another thread, try to push it into its thread...
// if all of those failed, push into shared distributed lifo
}
_______________________
The fun part is this scheme can be realized as long as a node is at least the size of a pointer. That is the required overhead wrt the size of a node.