LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 09-01-2009, 09:54 AM   #1
ebd
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 0
any function for entering critical section?


hi
my question is:
if there are many vars shared between threads for condition checking
such as
if(shared_var1 > 0)
{...}
because other thread may do this at the same time
how to guarantee that threads exclusively access the var

i feel a bit troublesome to define respective mutex for every shared var that may be access by more than one thread. so, is there any function can do this.

in uCos, the OS_ENTER_CRITICAL function does this well
in Linux, is there any similar functions?
 
Old 09-01-2009, 12:54 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

http://www.linuxquestions.org/questi...d.php?t=751808
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
any function for entering critical section? ebd Programming 12 09-03-2009 12:08 AM
how to enter critical section in Linux Enviroment ebd Programming 2 09-01-2009 10:24 AM
Security of process’s data inside Critical Section(in locking) heroma Programming 1 06-12-2008 04:12 AM
Security of process’s data inside Critical Section(in locking) heroma General 1 06-11-2008 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration