Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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

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
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
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.

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 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

All times are GMT -5. The time now is 10:33 PM.

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