Sponsored Content
Homework and Emergencies Homework & Coursework Questions About dining philosopher problem Post 302942625 by rbatte1 on Thursday 30th of April 2015 11:26:15 AM
Old 04-30-2015
What is the aim of the code, apart from practice, but more specifically:-
  • What output are you hoping to achieve?
  • What is not working?


Regards,
Robin
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH Problem auth problem

Hi, Just recently we seem to be getting the following error message relating to SSH when we run the UNIX script in background mode: warning: You have no controlling tty. Cannot read confirmation.^M warning: Authentication failed.^M Disconnected; key exchange or algorithm negotiation... (1 Reply)
Discussion started by: budrito
1 Replies

2. Programming

dining philosophers problem

To avoid deadlock, I used a possible solution. The odd numbered philosophers grab the right and then the left while even numbered philosophers grap the chopsticks in the reverse order. Implement this solution using pthread mutual exclusion lock. Please look at my code, although it works,but the... (4 Replies)
Discussion started by: zhshqzyc
4 Replies

3. Shell Programming and Scripting

problem with dd command or maybe AFS problem

Hi, folks. Sorry for bothering, but maybe someone could help me please. The problem is the following: there is some script that copies files from local file system to AFS. The copying is performed with dd command. The script copies data into some AFS volumes. The problem appeared with one... (0 Replies)
Discussion started by: Anta
0 Replies

4. Solaris

problem in finding a hardware problem

Hi I am right now facing a strange hardware problem. System get booted with the following error: Fatal Error Reset CPU 0000.0000.0000.0003 AFSR 0100.0000.0000.0000 SCE AFAR 0000.07c6.0000.1000 SC Alert: Host System has Reset It happen 4 or 5 times and get the same error every time.I... (8 Replies)
Discussion started by: girish.batra
8 Replies

5. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

6. AIX

AIX OS problem? network problem?

Dear ALL. I installed AIX OS on customer sites. but Only one site is too slow when I connected telnet, ftp.. Ping is too fast. but telnet and FTP is not connected.. of course i check the configuration file on aix but it's normal. Do any Idea?? thanks in advance. - Jun - (3 Replies)
Discussion started by: Jeon Jun Seok
3 Replies

7. Programming

Dining philosophers

Hi. I`m writng script solving problem of dining philosophers but it does not work. PHILOSOPHER SRIPT: #!/bin/bash ./start.conf cd stol a=$1 #echo a$a #echo ilosc$ilosc #echo dziel$(($%$ilosc)) if ; then #next=$%$ilosc] next=1 else next=$ fi (0 Replies)
Discussion started by: Aryman1983
0 Replies

8. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

9. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

10. IP Networking

Router problem or ISP problem ?

Hi everyone, I am experiencing discontinuity of Internet service, this started 1 month ago. Everything worked very well for 1 year of intensive use, but now, I have problems reaching my gateway. The gateway is not my router but a node belonging to my ISP and I share the same public IP with... (3 Replies)
Discussion started by: remic
3 Replies
QSemaphore(3qt) 														   QSemaphore(3qt)

NAME
QSemaphore - Robust integer semaphore SYNOPSIS
All the functions in this class are thread-safe when Qt is built with thread support.</p> #include <qsemaphore.h> Public Members QSemaphore ( int maxcount ) virtual ~QSemaphore () int available () const int total () const int operator++ ( int ) int operator-- ( int ) int operator+= ( int n ) int operator-= ( int n ) bool tryAccess ( int n ) DESCRIPTION
The QSemaphore class provides a robust integer semaphore. A QSemaphore can be used to serialize thread execution, in a similar way to a QMutex. A semaphore differs from a mutex, in that a semaphore can be accessed by more than one thread at a time. For example, suppose we have an application that stores data in a large tree structure. The application creates 10 threads (commonly called a thread pool) to perform searches on the tree. When the application searches the tree for some piece of data, it uses one thread per base node to do the searching. A semaphore could be used to make sure that two threads don't try to search the same branch of the tree at the same time. A non-computing example of a semaphore would be dining at a restuarant. A semaphore is initialized to have a maximum count equal to the number of chairs in the restuarant. As people arrive, they want a seat. As seats are filled, the semaphore is accessed, once per person. As people leave, the access is released, allowing more people to enter. If a party of 10 people want to be seated, but there are only 9 seats, those 10 people will wait, but a party of 4 people would be seated (taking the available seats to 5, making the party of 10 people wait longer). When a semaphore is created it is given a number which is the maximum number of concurrent accesses it will permit. This amount may be changed using operator++(), operator--(), operator+=() and operator-=(). The number of accesses allowed is retrieved with available(), and the total number with total(). Note that the incrementing functions will block if there aren't enough available accesses. Use tryAccess() if you want to acquire accesses without blocking. See also Environment Classes and Threading. MEMBER FUNCTION DOCUMENTATION
QSemaphore::QSemaphore ( int maxcount ) Creates a new semaphore. The semaphore can be concurrently accessed at most maxcount times. QSemaphore::~QSemaphore () [virtual] Destroys the semaphore. Warning: If you destroy a semaphore that has accesses in use the resultant behavior is undefined. int QSemaphore::available () const Returns the number of accesses currently available to the semaphore. int QSemaphore::operator++ ( int ) Postfix ++ operator. Try to get access to the semaphore. If available() == 0, this call will block until it can get access, i.e. until available() > 0. int QSemaphore::operator+= ( int n ) Try to get access to the semaphore. If available() < n, this call will block until it can get all the accesses it wants, i.e. until available() >= n. int QSemaphore::operator-- ( int ) Postfix -- operator. Release access of the semaphore. This wakes all threads waiting for access to the semaphore. int QSemaphore::operator-= ( int n ) Release n accesses to the semaphore. int QSemaphore::total () const Returns the total number of accesses to the semaphore. bool QSemaphore::tryAccess ( int n ) Try to get access to the semaphore. If available() < n, this function will return FALSE immediately. If available() >= n, this function will take n accesses and return TRUE. This function does not block. SEE ALSO
http://doc.trolltech.com/qsemaphore.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qsemaphore.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QSemaphore(3qt)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy