LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


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

Rep: Reputation: 0
Question how to enter critical section in Linux Enviroment


hi,all
i'm wondering whether there is any available function for entering critical section: something like OS_ENTER_CRITICAL function in uCos

tks!
 
Old 09-01-2009, 09:36 AM   #2
ebd
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Original Poster
Rep: Reputation: 0
supplement:
it seems a bit troublesome to define a respective mutex for every shared var
 
Old 09-01-2009, 10:24 AM   #3
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by ebd View Post
supplement:
it seems a bit troublesome to define a respective mutex for every shared var
In that case, why not just define one global mutex for all shared variables? It works out almost the same as a global critical lock.

AFA a critical section, in userspace no such mechanism exists.

In kernel space, there are many different types of critical sections, but the most basic is via disabling all interrupts across all cpus. I'm assuming that you're not in kernel space, however.
 
  


Reply



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
GLib-GObject-CRITICAL and Pango-CRITICAL on Debian lenny kaz2100 Debian 0 10-07-2008 04:19 PM
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
how enter the command enviroment in GUI ztdep Linux - Software 1 07-20-2005 06:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:05 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
Open Source Consulting | Domain Registration