It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
32 articles posted by this person
Showing 32 of 1168 articles.
Currently 47 other people reading this forum.

 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 10:20pm Tue 17th Oct, Lewei X.

So I was chatting with a friend who said he was getting some weird file permissions when trying to create a file, so we ran the following code on our respective outputs and ended up with different file permissions include fcntl.h include unistd....

 UWA week 41 (2nd semester, week 11) ↓
SVG not supported 11:09am Mon 9th Oct, Lewei X.

Never mind, just watched the workshop which clarified things for me (currently out of the country so I couldn't attend the workshop in person)

SVG not supported 10:12am Sun 8th Oct, Lewei X.

I read in Jacob's post that if a subdirectory is empty, we do not create it in the other directories to be synced. E.g. if we are syncing bettwen dirA and dirB, and there is an empty subdirectory dirA dirsub then dirB dirsub won't be created ...

 UWA week 40 (2nd semester, week 10) ↓
SVG not supported 3:50pm Sat 7th Oct, Lewei X.

I do agree that empty subdirectories should be created in the other directories as it does make sense to make the directories to be synced exactly the same (in terms of structure and file contents). This is also what happens in cloud syncing. Also, I...

SVG not supported 10:15pm Wed 4th Oct, Lewei X.

Haven't used this forum much this project haha but now I finally found a question (kinda) to bother you with. Before I read the post titled Macro Definitions, I was searching up the maximum path names in Linux systems. I stumbled across MAX PATH whic...

 UWA week 39 (2nd semester, week 9) ↓
SVG not supported 9:50pm Fri 29th Sep, Lewei X.

Thanks for pointing this out, I was just about to ask about this. As mkdir is a utility program that is called in the command line, how is it possible to use it in the C program? Could you highlight an exmaple of each in case I end up doing something...

SVG not supported 11:04am Fri 29th Sep, Lewei X.

I think what the OP is trying to ask is if the -a option will sync (sub)-directories, or if (sub)-directories are ignored.

 UWA week 37 (2nd semester, week 7) ↓
SVG not supported 11:52pm Tue 12th Sep, Lewei X.

Although it is true that MAX RUNNING PROCESSES is the total number of processes in all the queues, I believe it is perfectly acceptable to define the length of the queues as this value. This is because all the processes may be in a single queue, espe...

SVG not supported 10:16pm Tue 12th Sep, Lewei X.

The command file you provided is perfectly valid. As you are reading from terminal, the read speed is only 10Bps, meaning reading just 5B will take 0.5 usecs which is 500 000 usecs I am assuming you are running the verbose output of the sample solut...

 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported 10:51am Sat 9th Sep, Lewei X.

Yes... This how it should run. As stated in the project sheet (and in the many clarifications that followed), we only spawn the first command in the commands file. If that command does not call spawn, then that is the only command that will ever run....

SVG not supported 10:47am Sat 9th Sep, Lewei X.

My brother in Christ you have 6 days left to do this project... And yes, an array of structures to store the commands with a nested array of structures for the syscalls will work just fine. Although the system calls have different values, they have a...

SVG not supported 9:47pm Fri 8th Sep, Lewei X.

Hi there, I did some testing and it looks like the sample solution just increments the time after unblocking a process, and then uses that time as the point of reference to check if the next process can be unblocked. E.g. in the example below, the R ...

SVG not supported
 ✅ Clarification  (both)
8:51pm Thu 7th Sep, Lewei X.

As stated in the project sheet, the simulation should only spawn the first command in the file. If that command does not call spawn, then that command is the only one that is run in the entire simulation. You should of course read all the commands in...

SVG not supported 1:19pm Thu 7th Sep, Lewei X.

Never mind, I think its because the command file has 12 commands, when the max is only 10. Don't know how my program doesn't crash, as I haven't added any file content checking

SVG not supported 12:13pm Thu 7th Sep, Lewei X.

I was doing some extensive testing of my program, and noticed that in the sample solution, unused commands seemed to be affecting the output in some larger command files. I tried downsizing the commands file to see if I could replicate the issue but ...

SVG not supported 4:11pm Wed 6th Sep, Lewei X.

Got this answer from a lab fac The acquisition of the data bus does not require the OS to be on the CPU. It happens in parallel to everything else. I believe it is because it is the device that acquires the data bus, not the CPU.

SVG not supported 4:09pm Wed 6th Sep, Lewei X.

If a process has any child processes, it will go to RUNNING- BLOCKED instead of RUNNING- READY. It only gets unblocked when all child processes has terminated. Try Shell 5usecs spawn second 6usecs wait 7usecs exit second 20usecs exit with a...

SVG not supported 1:55pm Tue 5th Sep, Lewei X.

I expect that the sample solution will be fixed on Thursday when Chris comes back. Would you like my discord? Email me at 237 9 5 t d n . w . d . u o u e i a t t e d m i c r e e

SVG not supported 12:38pm Tue 5th Sep, Lewei X.

First in, first out. You can test the sample solution to confirm this is the case.

SVG not supported 12:36pm Tue 5th Sep, Lewei X.

Thanks, this helped a lot. Literally the last thing I had to do before I got a fully working solution.

SVG not supported 10:46am Tue 5th Sep, Lewei X.

Multiplying the size by 1000 000 then dividing by the speed should give the time, but for some reason I keep getting errors. I got floating point error when trying to store in a long int?

SVG not supported 10:39am Tue 5th Sep, Lewei X.

Yeah, I did use mod, I did try multiplying the size in bytes by 1 000 000 first, but it didn't seem to work properly. Now i realised my dumbass forgot to use long long ints. Thanks for reminding me.

SVG not supported 10:24am Tue 5th Sep, Lewei X.

Hmmm, at the moment i'm just dividing the R W speed by 1 000 000, do the calculation, then store the time in an int which truncates it. I know that floats are inaccurate but i've done some testing and everything is calculating fine.

SVG not supported 10:17am Tue 5th Sep, Lewei X.

I found a much easier way and that is just to use mod. Check if there is a remainder to the division, and if there is, then it means that we must add 1usec to the R W operation time as it takes a fraction of a usec. I'm not even sure if we're allowed...

SVG not supported 10:16am Tue 5th Sep, Lewei X.

Yeah at the moment I just added 1usec before a syscall occurs. So I increment normally to simulate each usec, but then I have to increment again when syscall happens. I'm trying to change the structure of the main loop at the moment so that the incre...

SVG not supported 10:00am Tue 5th Sep, Lewei X.

Thanks, that definitely clears thing up for me. No typo was made, he is the Christ of C programming .

SVG not supported 9:54am Tue 5th Sep, Lewei X.

Yes, I do agree on this, just a bit confused after this post, as the 2 sleep processes wouldn't come close to unblocking at the exact same time Just to clarify this section If multiple processes can be unblocked at any time, they are unblocked (adde...

SVG not supported 9:41am Tue 5th Sep, Lewei X.

1. The read write processes in the sample solution seem to be mostly fixed, however, the time to complete the read write operation seems to be off by a multiple of 10. In the screenshot below, I am reading 10 Bytes from terminal which has a read spee...

SVG not supported 6:29pm Mon 4th Sep, Lewei X.

Thanks, it makes much more sense how a system call cannot occur at the end of its time quantum. However, I still have some concerns about the timing of a system call. For example, with a TQ of 2usecs and the following command file shell 1usec exit...

SVG not supported 4:29pm Mon 4th Sep, Lewei X.

At t 135, when 'c3' exits, 'cal' pid 1 should immediately be unblocked

SVG not supported 4:24pm Mon 4th Sep, Lewei X.

I was comparing outputs of my solution and the sample solution (after changing how time quantum worked and adding an extra usec before a syscall was executed) and somehow caused the sample solution to end up hanging in IDLE state. My solution produce...

SVG not supported 2:00pm Mon 4th Sep, Lewei X.

Thanks for the clarification, it made things much clearer for me. Still have 2 questions though 1. When time quantum time of system call. At this point I am assuming it is intentional, that is, to move the process off running and run the system cal...

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy