LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 10: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, 01:54 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:08 AM
how to enter critical section in Linux Enviroment ebd Programming 2 09-01-2009 11:24 AM
Security of processís data inside Critical Section(in locking) heroma Programming 1 06-12-2008 05:12 AM
Security of processís data inside Critical Section(in locking) heroma General 1 06-11-2008 11:56 AM


All times are GMT -5. The time now is 04:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration