I’m developing an developing a little software in c# that connect to a Linux server. the software send a HEX String and receive a HEX String Back. here is my code an example of a string is 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x34 0x03 0x30 0x30 0x30 and the response is this 30 30 30 30 30 30
Tag: c++
Error when trying to deploy Qt application using shared libraries
I tried to deploy a qt application using the shared library approach described here: http://doc.qt.io/qt-5/linux-deployment.html (5th headline) When I go to my project folder and type “make clean” I get this error: “make: *** No rule ro make target ‘clean’. Stop” What is the problem here? Also: The documentation states: “We assume that you already have installed Qt as a
How is shmat() etc. implemented in the Linux kernel. Is there any other way to share memory?
with mmap(), processes must inherit the mapping from a parent to share memory. is there a way to share memory between processes that don’t share a parent? shmat() seems to be the best solution, but it requires clean up if the processes didn’t detach the memory on exit/die. Domain sockets are close to sharing memory… Answer With mmap, processes must
What is the maximum number of threads that std::async will create and execute asynchronously?
I have a large number (>>100K) of tasks with very high latency (minutes) and very little resource consumption. Potentially they could all be executed in parallel and I was considering using std::async to generate one future for each task. My question is: what is the maximum number of threads that std::async will create and execute asynchronously? (using g++ 6.x on
Poco C++ Libraries: “Not found: mysql”
I am using poco-1.7.7 with MySQL. I am building with g++ on Ubuntu. Building, linking and running works fine. However, when a Data Session is created, an exception “Not found: mysql” is thrown: The mysql client is installed and is part of $PATH. Additional information: I am running Ubuntu using Docker. See below for Makefile. The same code can connect
Generate raw binary from C code in Linux
I have been implementing just for fun a simple operating system for x86 architecture from scratch. I implemented the assembly code for the bootloader that loads the kernel from disk and enters in 32-bit mode. The kernel code that is loaded is written in C, so in order to be executed the idea is to generate the raw binary from
Linux best practice to start and watch another process
In my process I need to start/restart another process. Currently I use a thread with a tiny stack size and the following code: I feel like that’s not best practice. I have no idea about the resources the std::system() call is blocking or wasting. I’m on an embedded Linux – so in general I try to care about resources. Answer
Using shared memory and how to correctly unallocate a space with IPC_RMID
I have 2 applications running on my linux box, a server and a client. My server and client examples I am working with is from Dave Marshalls examples. Everything works well, but when I try this in my background process and I want to extend my original segment (perhaps due to an application upgrade in the future) I either have
What would be the disadvantage of creating an array of really big size on 64 bit systems?
Operating systems like Linux work on the principle of Copy-on-write, so even if you are allocating an array of say 100 GB, but only use upto 10GB, you would only be using 10 GB of memory. So, what would be the disadvantage of creating such a big array? I can see an advantage though, which is that you won’t have
can /proc/self/exe be mmap’ed?
Can a process read /proc/self/exe using mmap? This program fails to mmap the file: Answer You are making 2 mistakes here: Mapped size must be > 0. Zero-size mappings are invalid. You have to specify, if you want to create a shared (MAP_SHARED) or a private (MAP_PRIVATE) mapping. The following should work for example: If you wish to map the