Search Results

Search: Posts Made By: sehang
Forum: Programming 05-12-2011
1,691
Posted By Loic Domaigne
I'm glad that I won't end-up maintaining your...
I'm glad that I won't end-up maintaining your code...

I played with it a bit, took me some time to get the client working without crash:

- A Pthread_attr_init is missing for rx (Client.c:218)...
Forum: Programming 05-05-2011
4,558
Posted By Corona688
Try fprintf(stderr, "%p\n", v); to see if the...
Try fprintf(stderr, "%p\n", v); to see if the pointer value has become corrupted somehow.

If all you're passing is one integer, why allocate memory at all?

void *value=(void *)42;
int...
Forum: Programming 05-05-2011
4,558
Posted By Loic Domaigne
Are you working on Linux? If so, can you run your...
Are you working on Linux? If so, can you run your program under valgrind supervision?
Forum: Programming 08-26-2010
11,875
Posted By fpmurphy
I assume that this is a typo - the second...
I assume that this is a typo - the second pthread_mutex_lock() should be a pthread_mutex_unlock().

pthread_mutex_lock( &_L_LOCK );
Shared_VariableA.uint16 = in;
...
Forum: Programming 08-26-2010
11,875
Posted By Corona688
If properly bounded by mutexes(or other...
If properly bounded by mutexes(or other synchronization calls) it shouldn't need "volatile". Atomic operations might still need it.
Forum: Programming 08-25-2010
12,231
Posted By Corona688
A few problems with writing it in C. 1)...
A few problems with writing it in C.

1) You're assuming variables are atomic. Sometimes they're not.

2) You're assuming different threads have access to the same memory/cache. In multicore...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy