Tuesday, October 22, 2019

Digest for comp.lang.c++@googlegroups.com - 3 updates in 3 topics

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 22 02:33PM -0700

On 10/18/2019 3:20 AM, Frederick Gotham wrote:
 
> Is there anything wrong with the following code to create a vector that uses global memory?
 
> Is there anything like this hidden in some corner of Boost?
[...]
 
Fwiw, this reminds me of a simple region allocator I did in C:
 
https://groups.google.com/forum/#!original/comp.lang.c/7oaJFWKVCTw/sSWYU9BUS_QJ
Jorgen Grahn <grahn+nntp@snipabacken.se>: Oct 22 08:58PM

On Tue, 2019-10-22, Frederick Gotham wrote:
 
>> That is just so wrong..
 
> I already explained that I do this so that I know I'm not dealing
> with a C++03 compiler.
 
I recommend not doing it in examples posted to comp.lang.c++, unless
you want endless side discussions about it.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Oct 22 02:15PM -0700

On 10/22/2019 2:09 AM, Frederick Gotham wrote:
 
> Supervisor has limits though: If it tries to restart a process and it immediately crashes again, then it will try one more time to restart it, and then it will stop trying.
 
> When the computer is configured a particular way, for example let's say we change the config file from "gas_source=alkane" to "gas_source=halogen", then the "gas_monitor" program no longer has a purpose.
 
> Since "gas_monitor" is no longer needed, I can close it. . . but then Supervisor will try to restart it two more times, and it will close another two times. Then if the config file is changed back to "alkane", Supervisor won't try to restart the gas_monitor process because it's already failed the maximum times of two.
 
Send a request to the Supervisor to close the "gas_monitor"?
 
In other words, the Supervisor should have a shared memory queue, or
even a socket such that other programs can communicate with it. To shut
down the gas_monitor, have the configuration program ask the Supervisor
to shut it down. To start it back up, just tell the Supervisor to go
ahead and do that.
 
 
> m.lock();
> m.lock();
 
> Am I right?
 
This is bad mojo. Are you familiar with robust mutexs?
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: