Anonymous
what?
Is it better than debian ubuntu
Anonymous
Is it better than debian ubuntu
i think u r not sure between about the defference between desktop environment and distros
Anonymous
No no
Anonymous
I got your point.
Anonymous
I am asking that which distro would be better than ubuntu...environment that will i manage..that other thing
Anonymous
KDE neon is just "Ubuntu LTS+KDE desktop environment". LTS distros are for stability, and rolling distros are for new softwares. You decide
Anonymous
I need a distro with best looking and near stable with good package management system
Anonymous
Ty
Anonymous
👍
Anonymous
Dup, my linter always shout at me "Hey tab bomb detected, use space to heal"
Anonymous
u guys use spaces for consistancy? 4 hit on spacebar each time takes time
Amrutam
yeah. ..thats better
Anonymous
Google C++ standard :D
Anonymous
Code vulnerabilities: https://security.web.cern.ch/security/recommendations/en/codetools/c.shtml
Buck
guys, i need a suggest: how i allocate dynamic memory shared between more process? i try to explain better: i have a process that generate (with fork) 20 child process. i have created two struct: // data of the single child process struct single_data { unsigned long content; pid_t writer; }; // type of data structure struct shared_data { // index where next write will happen unsigned long cur_idx; //* vector that contains all data to be written: //* - vec[i].content = i //* - vec[i].writer = PID of process who wrote i in vec[i].content struct single_data vec[NUM_PROC*NUM_ITER]; }; but now the size of this struct is defined in the header by num_proc and num_iter. how i can converter them to dynamic allocation?
Buck
I hope I have explained well
Anonymous
Anonymous
the size must be constexpr.
Buck
mmm... i don't understand
Buck
I forgot to say it: only c, no c ++
⚛ Hz
http://en.cppreference.com/w/c/language/array c have Variable-length arrays
⚛ Hz
But I think you should use malloc and change declaration from array to pointer
Buck
I'm trying to solve writing information on a file.txt and not in shared memory
Buck
for now it works, even if I'm afraid of having problems for simultaneous access.
Anonymous
Hi friends any one can sent me please reference book for c++
Harut
Deytel download
⚛ Hz
http://en.cppreference.com/ cppreference.com
Oluwaseyi
Oluwaseyi
Pls, I need help for this question
Anonymous
Why use short, int and long, where Int16, Int32 and Int64 are more clear/understandable? Any Time-Space etc benefits
Anonymous
Besides: https://clang.llvm.org/extra/clang-tidy/checks/google-runtime-int.html
Evgenii
you have fast modification for that
hari
#request #embedded c programming tutorials #text PDF #source
Evgenii
Kovi
Hey... is there a anyone who can help me with a small java script issue... I'm new to this....😳
Kovi
Oh is java prohibited here?
Liam
Oh is java prohibited here?
Main topics here are C/C++ and their friends. Questions about other languages are not recommended here, but not strictly prohibited. However, please kindly make sure that topics about other languages shall not disturb discussions within main topics here; and also, asking questions about other languages in the right group makes you easier to get answers.
Kovi
Thnaks
Kovi
@letstalkprogramming
Thank you very much
Anonymous
good morning group. I did a simple program, but this one with erroneous results. If possible, someone could look at my code for me. Please
Anonymous
1. Post errors 2. What you tried?
Buck
Why if a declare a shared memory in main.c when I do fork() and execve the child (child.c), the child don't see the shared memory? The variables are declared in header.h but if I declare them in main.c it does not work anyway
Buck
Because fork creates a whole new process, and memory of all processes is seperated. What you're looking for is a thread
No, if I put everything in the same time (main.c) it works. It stops working only when I split into 3 files (main.c child.c header.h)
Buck
Buck
is a bit 'confused, I hope you understand the problem
Roxifλsz 🇱🇹
is a bit 'confused, I hope you understand the problem
I don't have experience in what you're using in your code. I cannot help you, someone else might be able to help you though
Buck
Ook thanks
Anonymous
If someone fixes your code, you'll never learn :D
But that's not what I want. I've been testing a code on a problem proposed on "Online judge" some tests are right and some are not
Anonymous
I just wanted some tips.
A
Hi
Anonymous
Hi
Álvaro
1000 members
Álvaro
wow
Anonymous
Nothing special, wait for 1024.
Roxifλsz 🇱🇹
It does say up there that it's 1K
Roxifλsz 🇱🇹
Heh like a kilobyte
Álvaro
Liam
Why if a declare a shared memory in main.c when I do fork() and execve the child (child.c), the child don't see the shared memory? The variables are declared in header.h but if I declare them in main.c it does not work anyway
fork() generates a new process as the child-process of the original one. For the virtual memory space, Linux handles it by COW technology. This optimization roots on the fact that, if exec*() another program is called in the child-process imediately after fork(), eager copy the virtual space is useless. In your case, you fock() from gestore and then execl() the program figlioA, which matches the design of fork-COW. Hence, in the child-process, the whole virtual space of its father-process is dropped and thus invisible. If you put everything in the same source file, and keep running the same program in the child-process, the virtual space inherited from its father-process will then COW-ed, and hence elements are still valid and visible. However, for this situation, your shared_data is shared between the two process only for the name —- modifying it in one process triggers Linux to copy it in physical memory and to reattach the map between physical memory frame and virtual memory page, and thus the modification is invisible in another process.
Liam
Why if a declare a shared memory in main.c when I do fork() and execve the child (child.c), the child don't see the shared memory? The variables are declared in header.h but if I declare them in main.c it does not work anyway
For your purpose, try the POSIX API shm_open and mmap. A successful call to shm_open() returns a file descriptor to a region of memory named name of access mode oflag and with (if creating a new shared memory segment) permissions mode. Then you size it via ftruncate(), and finally to map the segment into its address space with mmap() . Other processes then call shm_open() with the same name to open the segment and mmap to get a pointer to it.
Liam
However, unless you are an expert in this field (unfortunatelly, seem not), you do not share memory between processes. This breaks the secure isolation between processes provided by Linux, and makes memory volatile-ed. Finding a workaround of it, socket pair between processes is a good choice. See the introduction to it and a hello world-demo: https://users.cs.cf.ac.uk/Dave.Marshall/C/node28.html