Question regarding multiple threads and segfaults
What happens when two threads of the same process running on different logical cpu hit a seg fault? ...
What happens when two threads of the same process running on different logical cpu hit a seg fault? ...
What's the state of the art in DNS resolver libraries? I am particularly interested in full (not stub) resolvers that support any or all of: making multiple queries in one request packet, complete DNSSEC validation, returning detailed information about DNSSEC validation to the application, and can handle experimental new RRs without muc...
In the following code, whatever is passed as retval is evaluated as given for every use of that token. #define _CPFS_RETURN(commit, retval) do { \ util_cpfs_exit(commit); \ return retval; \ } while (false) #define CPFS_RETURN_BOOL(retval) do { \ _CPFS_RETURN(retval, retval); \ } while (false) For examp...
Possible Duplicate: Tool for braceless, whitespace sensitive C syntax It recently occurred to me, after returning to C after several years of C++ and Python, that the use of curly braces is both ugly and contentious in a language for which I have great admiration. In particular, the use of K&R style leads to "hurried" statemen...
Possible Duplicate: Memory randomization as application security enhancement? hi, Can some explain me please what address space Layout Randomization is and how is it implemented. How does this technique affect the stack, heap and static data. Also I am interested in any papers that explain about the address space Layout Rando...
What is the difference between functions in math and functions in programming? ...
This function prints every number starting from 0000 to 1000. #include <stdio.h> int main() { int i = 0; while ( i <= 1000 ) { printf( "%04d\n", i); i = i + 1; } return 0; } The output looks like this: 0000 0001 0002 etc.. How can I make this more presentable using three different columns (perhaps u...
#define boo(fmt, ...) SomethingToDo(fmt, __VA_ARGS__) void foo(PCSTR fmt, ...) { // some other codes if(condition1) { va_list marker; va_start(maker, fmt); // Do something. va_end(marker); } if(somecondition) boo(fmt, /* I want to put the foo's va_arguments here */); } Ther...
Possible Duplicate: C fopen vs open What is the difference between open() and fopen() in C language? ...
The title is a bit of a misnomer, what I mean really is "C with classes". Let me explain, recently I bought the book ShaderX7 which came with a lite (and old) copy of the Unigine engine for one of the articles about shadow mapping techniques. I was dabbling through the code when I realized that, while the author was using C++ and inher...
I am writing a simple multi-drop RS485 protocol for serial communications within a distributed system. I am using an addressable model where slave devices are given a window of 20ms to respond. The master uC polls the connected devices for updates and they respond accordingly. I've employed checksums and take the necessary overrun pre...
We currently have some code to extract digits from an int, but I need to convert this to a platform without snprintf, and I am afraid of a buffer overrun. I have started to write my own portable (and optimized) snprintf but I was told to ask here in case someone had a better idea. int extract_op(int instruction) { char buffer[OP_L...
This question is a follow up of my previous question http://stackoverflow.com/questions/3572610/stack-growth-direction I would like to know whether stack is created by a compiler or OS/architecture ? Also how does OS knows about these compiler specific things ? For ex: C++ allows variables to create data on stack and heap while java a...
I have a four byte char array and I want to convert it to double. How can I achieve this in C. ...
I have a cuda program like this : for (int i=0;i<100000;i++) { if (i%2 == 0) { bind_x(x) // bind x to texture kernel_code<<A,B>>(M,x,y) // calculate y = M*x } else { bind_x(y) kernel_code<<A,B>>(M,y,x) // calculate x = M*y } cudaThreadSynchronize(); if (i%2 == 0) unbind_x(x) else unbind_x(y) // u...
Possible Duplicate: How do you reverse a string in place in C or C++? How to reverse the char array? ...
I have implemented strstr() but the code has is not working please help: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> char* mystrstr(char*,char*); int main() { char *s1,*s2,*flag; printf("Enter a string:\n "); gets(s1); printf("Enter a word to find in it:\n"); gets(s2); flag=mystrstr...
We have some services utilizing SunRPC on Linux (RHEL 4/5) that we'd like to speed up. Our RPC call require no return value, though by the nature of RPC, an ack is always sent anyway. This introduces latency that's recently become a problem - when run over a reliable transport (TCP), we'd hope to avoid the latency introduced by the RPC ...
How to transfer a binary tree (not a balanced tree) across two different systems efficiently, retaining its complete structure? ...
I have a program in Java that needs to write a file with integers of 8, 16, 32 and 64 bits and floating point numbers of 16, 32 and 64 bits. This file needs to be read by a program in C (and vice-versa). These programs are used in different type of machines, so the file needs to be independent of little or big endian. I am looking for a...