Sponsored Content
Top Forums Programming how to write codes "parbegin(p1,p2)" ? Post 101011 by zhshqzyc on Friday 3rd of March 2006 07:59:06 AM
Old 03-03-2006
I am going to implement Dekker's algorithm to guarantee mutex exclusion between P1 and P2.


Code:
void p1()
     {
         "Dekker's algorithm ..."
     }

void p2()
    {
         "Dekker's algorithm ..."
    } 


   void main()
  {
      parbegin(p1,p2);
       ...
  }

Should I use "fork" or others?

Thanks!
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

communicating wth another user aside from "wall" and "write"

Hi, Can anyone suggest a Unix command or c-shell algorithm to simulate to behavior of "wall" command minus the "all users"? What I'm trying to do is to send a notice to just one particular user but i dont want other remotely-logged-on users to receive the message (on the pseudo-terminals). I... (6 Replies)
Discussion started by: Deanne
6 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

Problems with "write" and "wall"

Hello, I am using VirtualBox to simulate a small network with two Linux computers, the host is Mac OS X. My problem is that I can't send "write" and "wall" messages from the host to one of those Linux computers. Here is what works: - The virtual Linux computer answers "ping" messages that have... (5 Replies)
Discussion started by: 123_abc
5 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

8. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
SoProfileElement(3)						       Coin						       SoProfileElement(3)

NAME
SoProfileElement - The SoProfileElement class is yet to be documented. FIXME: write doc. SYNOPSIS
#include <Inventor/elements/SoProfileElement.h> Inherits SoAccumulatedElement. Public Types enum Profile { START_FIRST, START_NEW, ADD_TO_CURRENT } Public Member Functions virtual void init (SoState *state) virtual void push (SoState *state) Static Public Member Functions static SoType getClassTypeId (void) static int getClassStackIndex (void) static void * createInstance (void) static void initClass (void) static void add (SoState *const state, SoProfile *const profile) static const SoNodeList & get (SoState *const state) Protected Member Functions virtual ~SoProfileElement () Protected Attributes SoNodeList profiles Detailed Description The SoProfileElement class is yet to be documented. FIXME: write doc. Member Enumeration Documentation enum SoProfileElement::Profile FIXME: write doc. Constructor &; Destructor Documentation SoProfileElement::~SoProfileElement (void) [protected], [virtual] The destructor. Member Function Documentation SoType SoProfileElement::getClassTypeId (void) [static] This static method returns the class type. Reimplemented from SoAccumulatedElement. int SoProfileElement::getClassStackIndex (void) [static] This static method returns the state stack index for the class. Reimplemented from SoAccumulatedElement. void * SoProfileElement::createInstance (void) [static] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. void SoProfileElement::initClass (void) [static] Initialize relevant common data for all instances, like the type system. Reimplemented from SoAccumulatedElement. void SoProfileElement::init (SoState *state) [virtual] This function initializes the element type in the given SoState. It is called for the first element of each enabled element type in SoState objects. Reimplemented from SoAccumulatedElement. void SoProfileElement::push (SoState *state) [virtual] This method is called every time a new element is required in one of the stacks. This happens when a writable element is requested, using SoState::getElement() or indirectly SoElement::getElement(), and the depth of the current element is less than the state depth. Override this method if your element needs to copy data from the previous top of stack. The push() method is called on the new element, and the previous element can be found using SoElement::getNextInStack(). Reimplemented from SoAccumulatedElement. void SoProfileElement::add (SoState *conststate, SoProfile *constprofile) [static] Adds profile to the list of profiles. const SoNodeList & SoProfileElement::get (SoState *conststate) [static] Returns current list of profiles. Member Data Documentation SoProfileElement::profiles [protected] FIXME: write doc. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoProfileElement(3)
All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy