Re: gcc & C++ instead of g++

2009-09-10 Thread Mohsen Pahlevanzadeh
Sorry, I'm gonna go to unsbscribe.
On Wed, 2009-09-09 at 23:42 -0700, Ian Lance Taylor wrote:
> Mohsen Pahlevanzadeh  writes:
> 
> > How do i write C++ with gcc instead of g++?
> 
> The question is not appropriate for the mailing list g...@gcc.gnu.org.
> It is appropriate for gcc-h...@gcc.gnu.org.  Please take any followups
> to gcc-help.  Thanks.
> 
> There is no particular reason to use gcc instead of g++.  If you really
> want to do so, there are two easy ways: 1) name your files with an
> extension of .cc rather than .c; 2) use the -x c++ option.  Note that if
> you link with gcc, you will need to explicitly use -lstdc++.
> 
> Ian



link list & thread

2009-11-08 Thread Mohsen Pahlevanzadeh
Dear all,

I have a thread & 2 func.flush_2_db() is in thread & add_element() is
outside of thread.
add_element's job is adding data to link list.& flush_2_db()'s job is
reading list & drop from list.But my problem is override data & lost
data, because flush_2_db is in the thread & both work parallel.
Do you have any idea for solving my problem?

Yours,
Mohsen



multi threading & load average

2009-11-16 Thread Mohsen Pahlevanzadeh
Dear all,
I wrote a program & when i monitor it with "top" command, i see an
incremental load average.When i see with a profiler program same oprof,i
saw function of my thread has 66%  activity.
I read many body of that function,but i have got 1 result: i didn't use
thread as safely.
Do you know on attributes of thread that i decrease load average of
system?
help me...
Sorry for my language.