const_cast<> supposed to "cast away const" but it does not. The output is: 1002 1001, I expect it to be 1002 1002. Could someone explain what's going on? Thx.
Also, 0x7fff0d065098 is 140,733,411,905,688 decimal, which is 140 Terabyte, 733 MB, and so on. I have only 8GB of RAM on my laptop, how is that possible?
My FIFO is a class, it is the producer and consumer applications use select() to monitor sockets and stdin besides the FIFO so the loop is quite involved.
I have a producer application that writes data into a FIFO, and I have a consumer application that reads data from FIFO utilizing select() and read() functions inside of a while(true) loop....
> If you know in advance that the string will become very long, it could make sense to call "reserve" upfront. This way there will be less memory reallocations during the string building process. But...
Creating threads is not difficult at all, it takes only a few lines of code - find some samples. Parallelizing your code to run on those threads would be challenging - google for it, I bet you'll...