Working on it. It's harder than it sounds to guarantee order AND guarantee safety.
---------- Post updated at 11:18 AM ---------- Previous update was at 11:09 AM ----------
How about this:
basically, rdpos and wrpos get incremented without limit, and % SIGBUF_SIZE is used to wrap their values to inside the array. We do 'unsigned int off=(wrpos-rdpos)' instead of just comparing rdpos and wrpos because, if it hits integer wraparound, rdpos might be near INT_MAX while rdpos is practically zero. Subtracting gets rid of the wraparound.
You shouldn't call get_value in a signal handler, but put_value ought to be safe.
Hi All,
Rather than re-invent the wheel, I am trying to find a mature C library that provides generic support for lists, trees, etc.
I understand C doesn't formally support "generics", but am aware of a few solutions like GLib and SGLib.
Can anyone kindly recommend what they think is best?... (1 Reply)
Hello,
I wonder if I can write my userdefined data structures(ex: a list) to a shared memory segment?
I know, the shm functions get (void*) parameter so I should be able to read and write a list into the shared memory.
may someone inform and clarify me about that, please? (1 Reply)
Here is what i need to do.
@data #has all column wise data so say info for col 1 location for all rows would be in this array
$array = \@data
But i need to create a file which should contain these information in a format for all columns even if i have got no values from some of the index... (0 Replies)