A few hours work, it won;t compile but it is all there.
I simplified the threading issue, consent can be message driven, executed in the calling thread with a mutex, like xhars does.
But any thread making a request will block, until consent has arrived from all the nodes. So I have thread signaling going on, mainly between the socketio.c manager which delivers inter node messages. So I assume a cutnpast packet service from sockets, which has been done so many times
So, under the socket thread, the consent will have accumulated, and the requesting thread signaled to continue.
All of about an hours work, the new stuff really being just organize the oddities of args list, on a binary tree, with status fields; the only code unique to the function. Seriously, your favorite search engine, there is an example, cut paste, the call structure, just add the parts unique to your application. Then give this snippet an entry point with three types of calls, new node message, request and release. Everything having the same clean interface, all messages just recaste from args, and you are good to go in the local data structure.
The only thing unique, the spaghetti peculiar to the function, is that this retains state on some chunk of memory, it has to count incoming consents and keep tha on the tree, search the tree, merge nodes on a release, split them on a request. Enough uniqueness, but nothing there that makes it more than a snippet, forty lines of code for the main algorithm it is quite simple as it relies on well behaved threads. This is barely more than a hardware segmentation manager, and i expect it to be a chip at some point, even a tiny teeny chip.
The result is elegant, across the enterprise, any two processes just 'printf' to a string, no matter where they are or what language they do it, the string appears in the proper window, because the data manage control semantics from top down.
No comments:
Post a Comment