Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
1715f304
Commit
1715f304
authored
Nov 20, 2010
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed code for assignment 4 of Operating Systems.
parent
d3c10b1d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
208 additions
and
94 deletions
+208
-94
os/ass4/main.c
os/ass4/main.c
+179
-94
os/ass4/main.h
os/ass4/main.h
+29
-0
No files found.
os/ass4/main.c
View file @
1715f304
This diff is collapsed.
Click to expand it.
os/ass4/main.h
0 → 100644
View file @
1715f304
/*
* Assignment 4 of Operating Systems: PThread simulation.
*
* Sander van Veen (6167969) and Taddeus Kroes (6054129).
* <sandervv@gmail.com> and <taddeuskroes@hotmail.com>.
*
* Submission date: 21 november 2010.
*/
typedef
struct
diner_stats
{
unsigned
int
meals
;
unsigned
int
forks
;
unsigned
int
id
;
unsigned
int
locked
;
}
diner_stats
;
/*
* Duration of the diner party (in seconds). When this time limit is reached,
* all philosophers are requested to pay their bill and leave the party.
*/
#define TIME_LIMIT 10.f
int
philo_left
(
diner_stats
*
stats
,
int
id
);
int
philo_right
(
diner_stats
*
stats
,
int
id
);
int
philo_optimistic
(
diner_stats
*
stats
,
int
id
);
int
philo_shy
(
diner_stats
*
stats
,
int
id
);
int
philo_random
(
diner_stats
*
stats
,
int
id
);
typedef
int
(
*
philo_t
)(
diner_stats
*
,
int
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment