Search Results

Search: Posts Made By: sehang
Forum: Programming 11-02-2010
11,816
Posted By sehang
I am using Lamport's bakery algorithm to control...
I am using Lamport's bakery algorithm to control all threads since I need no starvation.

---------- Post updated at 10:13 AM ---------- Previous update was at 10:00 AM ----------



Hi,
I...
Forum: Programming 11-01-2010
11,816
Posted By sehang
The real problem like this, My program has...
The real problem like this,
My program has about 10-15 threads, they do not run at the same time, depending on what service is triggered, and then each thread may maintain 5-6 shared variables;...
Forum: Programming 11-01-2010
11,816
Posted By sehang
If I have many shared variables (more than 100),...
If I have many shared variables (more than 100), what is the better solution?
Forum: Programming 08-26-2010
11,816
Posted By sehang
Thanks.:)
Thanks.:)
Forum: Programming 08-26-2010
11,816
Posted By sehang
It is possible create a variable with "volatile"...
It is possible create a variable with "volatile" but it is not a primitive type, e.g.

struct STRUCT {
volatile int S1;
volatile char S2;
volatile unsigned short int S3;
}
volatile...
Forum: Programming 08-26-2010
11,816
Posted By sehang
/* Shared Variables. */ struct STRUCT...
/* Shared Variables. */
struct STRUCT Shared_VariableA;
enum ENUM Shared_VariableB;

UINT16 GetVA () {
pthread_mutex_lock( &_L_LOCK );
UINT16 TMP = Shared_VariableA.uint16;
...
Forum: Programming 08-25-2010
11,816
Posted By sehang
pthread_mutex_lock in ANSI C vs using Atomic builtins of GCC
I have a program which has 7-8 threads, and lots of shared variables; these variables (and also they may not the primitive type, they may be enum or struct ), then they may read/write by different...
Showing results 1 to 7 of 7

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