Hello everybody and welcome to the several hundred people who have joined us for tonight's webinar and also the viewers who are watching the recording which will be out in due course. MHPM would like to acknowledge the traditional custodians of the land, seas and waterways across Australia upon which our webinar presenters and participants are located. I'm currently on Balangara country in the north of Western Australia and we pay respect to the elders past, present and future for the memories, the traditions, the culture and the hopes of Aboriginal and Torres Strait Islander Australia. So Steve Trumbull is my name, I'm a general practitioner by background, currently traveling and I'll be facilitating tonight's session thanks to the miracle of modern technology from El Cuestro station in the Kimberley. So there you go. I'm involved in medical education and one of the things I really enjoy is doing these webinars so we're lucky tonight to have a wonderful panel. I'm not going to go through their bios in detail because they were circulated with the webinar but the first person I would like to or like you to meet is Bill Buckley who is from Victoria. He's an alcohol and other drugs mental health educator with lived experience. So Bill as an educator in the AOD sector what key messages do you provide for your students about the importance of language when engaging with clients? Steve I generally like to stress the importance that language does play and that you can't underestimate the impact that language does have on someone's ongoing recovery. Great so really important then to make sure that we're using appropriate terminology which I know we'll come to in more detail with your presentation so looking forward to that. But Mary so Dr Mary Amalaeus is a psychiatrist based in where Coinsland meets New South Wales on the coast there in Carumbin. Introductory question for you Mary from what Bill said the terms we do use to describe people are very important. How does this sit with the health systems need to label us with a diagnosis before we can access services? Steve I think that that would probably be a topic of its own for another webinar but I think that there are definitely I don't know there's an art of balancing what the system needs but remembering that we treat people not disorders and it can be really difficult when you feel as a clinician or a helper backed into a corner where you've got to give someone a label which they might find stigmatizing but on the other hand some people find diagnosis really helpful and sometimes they're very important so in tonight's case for example alcohol use disorder kind of indicates the severity of the problem which actually can be clinically very important so I think the answer is it's complicated. Okay thanks for that I've heard it said that labels are for jam jars so I suspect that we'll come to that later on as you say it's a carefully balanced decision about how much labeling to do in order to get access to services without stigmatizing and speaking of stigmatizing though Hester Wilson so from New South Wales a general practitioner with a very strong profile in the assisting people with alcohol and other drug disorders it does seem Hester that we can too easily stigmatize a person because of their behaviors is this a risk in general practice especially with the advent of real-time prescription monitoring? Yeah thanks Steve look real-time prescription monitoring and it's called different things depending on your state you're in whether it's safe script Victoria or safe script New South Wales or Q script or the other the other ones around the country it's been something that we're very pleased has been introduced because it can support safer prescribing because we know that prescription medicines particularly the psychoactive ones can be risky and can cause harm but the issue is how we have those conversations and how we make sure that we give really clear messages around wanting to assist someone to have best health outcomes to to limit harm and not to label and discriminate the risk being that if somebody is turned away from accessing prescription medicines that if they do have a dependency if they do have a prescription medicine use disorder that they will end up having to access more risky drugs and we've certainly seen this in the states where people have been turned away and they're therefore moved towards using heroin now heroin is an opioid just like other opioids but it's injected it has a quick onset and so the risk of serious overdoses is much higher so it really is looking at how we can walk a real middle path through supporting our patients for the best possible health outcomes and decrease risk of harm. Thanks Esther it sounds like we're going to be talking a lot tonight about striking that balance in the order to achieve the best for our clients so that's a good place to start from we will be talking about the case in just a moment but before we do that there's a few things just to cover off quite quickly the ground rules being respectful to other participants and panellists as we would expect from fellow professionals there is the chat box and please use that to chat with each other just try and keep it on topic so that it doesn't distract people from what's being said in the main part of the webinar. You can change the slide and video layouts by clicking on the icon with the two arrows inside a circle in the top right corner that makes the video larger and the slide smaller whether you are interested in the people who are talking or what they're showing on the slide or whatever to get a closer look you can move those around. If you want to see slide only or video only you click on the square icon with an upward and right direction arrow icon in the bottom right corner of the slide or video window you'll figure that out as you go. Now the webinar platform is there on that next slide showing all that now the learning outcomes let's talk about those because they're very important that people feel that we've addressed those tonight which is certainly our intent we want to discuss the difference between harm reduction and abstinence and how these approaches relate to mental health. We're going to outline how to work with people who are experiencing mental health challenges who are currently using or have used alcohol and other drugs in the past. We will be talking further about stigma and the importance of language and communication we're providing care to people seeking assistance for AOD use and finally this is really the importance of the MHPN I think is to look for identifying strategies to engage specialist surgeons and other colleagues when supporting people who are experiencing mental challenges due to their current or past use of alcohol or other drugs. Now you've all seen the case study it is available under the information icon down there at the bottom there it's the case of Mike who will be very familiar to many of you who worked in this field for some time and the issues he's had with alcohol and its effect on his behaviour and his relationships over many years and the point that he's come to now in his life where he's coming to request support from our panellists and the first person who's going to talk about Mike's case is Bill who you've already met who's an alcohol and other drugs mental health educator. So Bill over to you to take us through your presentation please. Thank you Mike. Good evening everyone. After reading Mike's scenario and for the purpose of the webinar I'm going to assume that Mike has already embraced the concept of abstinence as it says that he's completed a detox and he's doing relapse prevention. With that in mind I would strongly encourage Mike to have a full mental health assessment just to have a thorough assessment and see if there is any other issues going on other than his substance use disorder. I'd encourage him to attend weekly counselling appointments if he wishes for probably a three month period. I'd say that'd be he wise because he's going to I would think he's going to need a lot of support the next three to six months at least. I would explore and explain the potential benefits of the life skills program to Mike. From reading the seminar it seems that Mike has spent most of his last 20 years of life working and drinking and not doing much else. There's probably a strong likelihood that he's failed to develop some of the skills in life skills areas such as emotional literacy, assertiveness, handling anxiety, goal setting etc. If possible get him involved in something that's going to address those areas of his life which will no doubt impact on his longer term recovery as well as exploring options to develop new social circles. From reading the seminar doesn't seem like he has any friends that don't drink in the manner that he used to. So I'm not suggesting he totally changed his whole social circle however perhaps it could be useful to have at least a handful of friends that that don't drink if that's what he's endeavouring to do. I'll explain to Mike the difference between a lapse and a relapse which we can extrapolate further on that later if need be. Next slide please. Okay so I strongly encourage Mike to explore the option of attending weekly meetings at the community-based peer support network at least in the initial stages of his recovery. Now if it's a minute it could be a smart recovery group or if he chooses to remain abstinence based a well-stepped fellowship would probably be best for that. The reason I suggest this is because most of us would probably be working with Mike for an hour a week or an hour of fortnight perhaps that leaves a lot of time in between and he can access peer support in these in the interim in between our appointments could be useful for him but also strongly encourage him to explore options for new historical recreational pursuits not associated with drinking could be perhaps looking at his earlier life early childhood and he you know looking at things from a strengths-based perspective was running sports that he he did have a strong interest in earlier on or hobbies before he commenced drinking at the the rate that he he currently is or was I should say. Most importantly I'll explore in presenting and all potential obstacles or barriers to continued abstinence if that's if abstinence is indeed his goal so sitting down with Mike and saying so where do you think this is going to be a problem Mike where where are you going to come up against barriers or obstacles to achieving this absence that you want to achieve and then help him to go up strategies for each of the identified obstacles so relapse prevention planning in short our next slide please okay um moving on to this is it could be you could take this on board when working with a client such as Mike but also it could be some of this stuff is is general information for when I'm working with someone who's struggling with AOD and or mental health issues so I always encourage ownership and responsibility for their recovery and treatment outcomes I don't have a magic wand much too many of my clients dismay I can certainly point them in the right direction and provide a good direction and resources perhaps but at the end of the day they're going to want it and they're responsible for it so plus many of our clients as you may or may not know struggle with a sense of feeling or a perception that they're not in control that everyone else you know they're at the whim and mercy of everyone else when that's not the case so encourage ownership and responsibility for their recovery I explain the difference between abstinence versus harm minimization or problematic substance use versus a substance use disorder and let the client choose which fits for them a thorough assessment of other life domains for example accommodation relationships employment legal status because well all these areas are going to impact on their life and their ability to tackle their new found recovery so support in those areas is going to flow on to support in their recovery from substance misuse you always utilize a strength based recovery focused approach to treat people as individuals avoiding labels always for instance jack is struggling with or in recovery from problematic alcohol or substance use as compared to an alcoholic or an addict Alice is struggling with schizophrenia rather than Alice is schizophrenic um labels don't go more often than not labels are not useful so do not use the term of alcoholic unless the client identifies themselves of one you should maybe explore that if you wanted to next slide please okay so many clients or many of the clients that I see will not have a formal diagnosis of substance use disorder um that and it it may or may not be helpful to refer them to get one generally clients are tempting to make significant changes to the historical use of substances will experience some depression and and or anxiety ongoing post detox so they'll definitely experience that during detox but it's not uncommon at all for people to experience it ongoing uh for quite a long period and for a variety of reasons it can take three to five years to achieve sustainable emotional stability and recovery and that may or may not be linked to the the other life domains and the life skills that people have um and not developed over there at the time that they've been using substances so recovery really is um a lifelong journey thank you Steve yeah thanks so much Bill I must say I've got a list of questions I want to ask you after that uh which we'll come to in the um in the in the discussion later on but just one quick question maybe to ask about you said about maybe getting him to develop some social networks and friendships how do you what sort of tips have you got about going about getting somebody like Mike um uh engaged with people well I I would uh once as I also said explore historical things he's been involved in hobbies um sports perhaps and um and and and explore whether he's like to re-engage and maybe support him to do that and and of course not everyone I mean sporting clubs are known for a bit of substance use but uh not everyone is a problematic substance user at a sporting club I'm sure he could find someone like mine but the peer support networks are also a great a great source of that but yeah if it's something that he's already interested in that does make a lot of sense yeah and he's going to have a lot of time on his hands as well Steve uh from the scenario since he went to work and spent the rest of his time in his shed yeah um I think he's going to have to find something else to do to sort of hang around in his shed yeah well maybe he'll shed with other people that'd be great I think so much Bill that's been great um now Mike's going to find his way to a general practitioner as often the case and Hester Wilson is the general practitioner in this situation so over to you Hester to take us through your presentation thank you Steve next slide please these are the learning objectives repeated so I'll get you to move on to the next slide so first of all I wanted to talk about the difference between harm reduction and abstinence and certainly as Bill has said the story um for Mike is that um he's he's had a long history so this is a man now age 43 with a strong family history of um alcohol use disorder and a parent who started smoking and using cannabis at quite a young age but didn't start drinking until his later teens but in his late 20s it really was starting to become an issue and and caused caused conflict in his relationship and he found it difficult to stop when it was clear that he needed to change his smoking and his drinking um for the pregnancy and it ended up in the relationship breaking up in the end and he tried cold turkey tried AA but without actually having a really good plan he ended up actually having a significant physical health issues in the form of a pancreatitis before he then went and did a medicated detox and that's now engaged in real life prevention but for many people and Mike may well be amongst them though he may have taken on that um that need to understand that need for him as individual to be abstinence and perhaps for that abstinence to be lifelong many people don't want to stop drinking they want to cut down their drinking they want to do social drinking they want to actually be a part of their lives it can be really difficult for people to get to a point where they say I can actually see my life without alcohol long term uh and some people will get to that point but many people won't and so it's working with people with where they're at it can be hard as a practitioner because you can kind of see the amount of harm this substance is causing it would be really good if you left alone completely but you've got to be um you know working with someone with where they're at as as as bill said really being aware of what the goals are so not everybody wants to stop and so looking at the things that you can do to help them reduce harm one of the things I'll say to people is every drink you don't have is doing you good you know so even if you cut down that is going to have an impact with other drug use looking at for example um the little syringe program so that you can access clean injecting equipment which means you don't then have issues in terms of blood-borne viruses looking at how you can do it in a less risky way so safer injecting techniques or you know not not drinking in in hazardous situations overdose management this is an important one um that we talked before about real-time prescription monitoring but in terms of um opioid use and opioid overdose we now have nixoid or naloxone which is a um an intranasal spray available on the pbs um and also available over the counter and and that is the epi-pin of opioid overdose so we really need to be thinking about that which patients can we suggest this is an option other issues safe consumption rules and we have two in Australia at the moment one in Melbourne and one in Sydney that are places where people go to use drugs and are supported there's lots of health interventions we ensure they don't overdose and there's very high rates of referral into treatment from those centres as well so for us it's around being with where the person's at it doesn't mean condoning risky behaviour you know it's very important to flag I'm concerned I'm concerned because of what you're doing but understand that that person may not be at that point and it's around helping them to build their sense of what they want and their skills their confidence and the importance of change in the way that they want to do it next slide please when we're thinking about mental health and drug and alcohol use and gambling as well I would put in this um as an aside it can sometimes be difficult to work at what comes first so is the mental health issue happening because of the drug use or is the drug use happening to actually manage the mental health issues or are they coexisting and it can be difficult to sort them out it is important to have a think about that and to to talk um with the people you're seeing around how it might work for them and how it makes sense for them there are a group of people who turn to substances to cope with life uh and unless they build skills and this is something that Bill talked about it can be really difficult for them to change that or sustain that change because it has a really important part of a very important function in their lives and one of the things I I really want us to think about and there's some debate here is dependency or addiction or use disorders substance use disorders are they mental health issue and I think that that's an interesting question that certainly it is very clear that the some of what happens as a result of these disorders are quite clearly physical illnesses um and that some people who experienced or use drugs and alcohol are very clear that they do not have a mental illness that that's not how they see it so once again it's working with the person that you're seeing to help them understand how their substance use and for Mike in his case it's the alcohol use how that's impacted his life and building his skills to manage that better next slide this is something Bill spoke about um and it is really clear that the experience of stigma causes harm it leads to rejection it leads to exclusion and discrimination people do not access care do not stay in care do not have good outcomes from care and it actually causes ill health in its very nature of being when we're thinking about language there's a really great publication um through nada which is called language matters um and they talk around the the things that sometimes we use and the better ones that we can use for example the idea of getting clean you know implies that you were dirty um you know and so we would think about um you know abstinence or harm reduction or you know we're using less less colorful words that are less stigmatizing as Bill said talking about the person with a condition they are not their condition they're a unique amazing individual that happens to have a particular condition um really think about what if you call someone a doctor shopper or if they're abusing medications what or substances what does that say and are there better words that you can use uh and then you know I always talk about um substance use disorder being a chronic relapsing medical condition this is real this is serious it is important and it needs treatment and it needs needs support and it needs time and effort on the part of the person to help manage it I'm really thinking about how you can help a person in terms of recovery using language that helps them to think that there is hope for the future um you know and so the idea that somebody is resistant is it highly unhelpful and so it may be that it's around they're not at a point in their lives or they don't agree with the with the treatment that you're suggesting and so that gives you a space to actually have a conversation around how you can engage to help them to make change um and and you'll be really aware that you may not be mean to discriminate or stigmatize but the language you use can make a difference to that also that people that have experienced stigma are really really open really really sensitive to it and so you may not mean to but you may stigmatize and so just checking out and making sure sometimes people do take on the language they will say I am an addict and I will always check out with them what does that mean for you is that empowering or does that hold you in a place where you continue to use because there's a sense of hopelessness and that was certainly something that Mike spoke about was the the hopelessness and the shame of the situation that he had in and the power that that has to hold people in that place next slide so once again um you know the interesting thing in Mike's case was the GP and that's that I can't help you and that's for me is just it is an experience that people have you know I would say that for us as GPs it is core to what we do to actually um ask people about behaviors that they're under taking that may cause them harm just like obesity overweight just like nutrition just like smoking alcohol other drugs gambling gaming those things that can cause harm it is part of our role to ask about them we may not have specific expertise in managing it but I would flag that for many people and if we're thinking about sort of risky or hazardous or problematic use for example of alcohol that's sometimes just having a conversation where you point to your concern for their health and well-being will help them to make a change and I have an example of that with a guy today who was drinking 10 beers at Friday Saturday nights and a couple of beers during the week and he didn't want to change that wasn't why you were seeing me but I'd flagged with him just concerned about your health you have diabetes you have hypertension you have hypercholesterolemia you've got sleep apnea I'm concerned about that level of drinking it's up to you what you choose to do but it's harmful for your health when I saw him again today he'd cut down to three drinks on Friday and Saturday night and no drinks during the week that was without me telling him to do that just raising my concerns and so that we'd have an important role in that as GPs as health practitioners be aware of what's available in terms of referral options don't forget health pathways and also online options which we're using more and more these days to support people particularly if you're in rural regional remote areas thank you very much great thanks so much indeed yes it's very clear I do fear that some of our colleagues do not go willingly into the support of people who are struggling with alcohol use and other drugs I'm just not quite sure you know what it is that tips one GP to being very open to supporting patients in that situation and others who just say I can't do this do you have any thoughts about that for a clear one look I think that I think there's sometimes a bit of a moral judgment so depending on the background that you come from but it's also that sometimes we can feel like we don't have the skills you know so I can't ask this because I don't have the skills to respond and and you know look I would would say you know at the very least we do need to be asking that question and we do need to know where to refer someone even if we're not confident with those skills ourselves whether it's to a later colleague or whether it's to the specialist services but you know it's a broad broad church gps or a broad church and we practice privately and so we do make a choice around what we do I just say you know if at the very least you know do ask about all those things all those behaviors that can affect people's health whether it's drinking or alcohol or obesity or nutrition or whatever because they do make a difference and know where to send someone if they're having issues. Sure thanks Esther and somebody in the chat room was just asking about the language guy that you mentioned I don't think we've got that in the resource list at the moment what was that one? That was the NADA language matters. NADA yeah I can search it up and put in the chat so it can be sent through. That'd be great we'll say NADA might be Russian for nothing I'm not sure but anyway there you go fantastic so thank you indeed for that now from GP to psychiatrist and moving on to Mary can you take us through your presentation please? Sure thanks Steve. Yeah so I just thought that I would look at the case story as through the lens of the DSM-5 substance use disorder criteria because it is useful to have frameworks to help quantify things or make sense of things sometimes and also to help communicate with other people so I mean I just really use as an example of really how serious Mike's problem has been so essentially there's four categories of symptoms that are included in the substance use disorder definitions in DSM so the first one is dependence so people might have cravings tolerance and withdrawal symptoms if they don't have it the use the level that they're using is risky so they might be having more of the substance than they intended to or continuing to use even when they know it's harmful it's causing social problems so the use continues despite the impacts on relationships work and recreation and so on and there's some impairment of control so people have tried to stop but been unable to and it can be a serious medical problem there's a lot of physiology involved in this both acutely and chronically it can be very serious so sometimes you know the diagnosis might be very important and Bill raised that in his presentation about considering whether whether or not it might be helpful to refer someone on to you know a health practitioner for that formal diagnosis next slide please I would have to say having said all that it is still possible to do that in a respectful non-stigmatizing way and using a strengths focus so just looking at Mike himself so some evidence that he that he has met criteria so he did try to quit 10 years ago and he couldn't stop and now and then he was drinking even more to cope with his day and to stop feeling shaky in the mornings when we meet him now he's just undergone a medical detox after he came very unwell but the evidence of you know impacts on his health actually date back some decades so he did have some that should be low sperm count not slow sperm count although they may have been slow I don't know he was increasing his use his pancreatitis is a recent occurrence and that's you know evidence of a really severe health problem his use of alcohol had been impacting his relationships and his work and as Bill pointed out we you know he's been going to work and drinking in his shed and we don't know anything else about what he does in his life for enjoyment or interest or other relationships and he's always been a heavy user so I wondered whether he might have a distorted perception of what normal drinking is and I unfortunately I think that's the case for a lot of Australians because our culture does kind of normalised quite heavy drinking he's always had big sessions and he's had years of being unable to stop it so he will probably need some really he's actually already decided on abstinence as Bill pointed out early on next slide please so also specifically with this case study there's possibly some genetic risk for him as his dad was a heavy drinker and I wondered about the impacts of developmental trauma on Mike as well and whether he might be doing some chemical coping as Hester mentioned in her presentation that would be something I'd explore further with him and there have been multiple stressors for him so he now has physical health problems he's got money problems he's lost his marriage he's going to have a lot of well he talks about having you know guilt and shame around what's what's happened and all of those things also elevate his mental health risks so I'll be keeping that in mind and then I noticed in the story also the different responses of different health professionals and and you know the sort of pull your socks up response of the GP 10 years ago meant that he then went away and didn't seek help for a really long time whereas when he's had a more empathic response it's enabled him to keep participating in that healthcare next slide please so I wanted to talk about so I'm a generalist psychiatrist I have to say Hester knows way more about alcohol use disorder than I do as an addiction specialising counts generalist physician but I do work in a facility where we do have a lot of people with alcohol use disorder and I've done quite a bit of psychotherapy with them and I really like both of these models Bill talked with us at the beginning about helping Mike to find some things in his life other than drinking and I find both of these models are useful for that so the first one is the perma which comes from Seligman's research on well-being not only Seligman a very big team of people over a couple of decades but these five domains emerged from their work as what contributes to well-being so I would ask Mike and we might even have to look back in the past what are the things you do that have given you or do you give you positive emotions we look for things like doing things in nature doing things with other people listening to music whatever sometimes you have to prompt people engagement is what are the activities it's so caught up in what you're doing you don't don't notice time passing um Steve fleetingly mentioned doing something in the shed other than drinking or doing something in a shed with other people so you can imagine if you was working on a project at a men's shed or something that might be a source of engagement positive relationships with all talks about community but does that does Mike actually have any relationships in life now what gives him a sense of meaning and perhaps he hasn't really ever known that or has lost touch with that and is there anything that he feels proud of so sometimes even since he's chosen abstinence sobriety to give people a sense of accomplishment and then helping him to set small goals for things that he wants to achieve or has an improvement in his physical health or he gets back to work or he reconnects with an old friend this framework is very useful for mental health and some substance use psychotherapy and it's all information so if someone doesn't have anything under any of those headings that's also really important and i actually incorporate this in a suicide risk assessment so if he has nothing that gives him joy if he doesn't have anything he gets absorbed in has no relationships no sense of meaning and never feels proud of himself i'm going to be really worried about him my other um favorite model is the healthy mind platter which is from dan sequel and others and it's not uh when you look at it it seems self-evident but i really like having a framework so i'd be checking in with him about you know what what's what sort of sleep pattern is healthy for him what's he aiming for how much physical activity does he need how can he get that what activities can he do where he's using his mind to focus connect connections with others is really important what does he do for fun does he do any activities where he can just play and that's going to be a new thing for him if it's not involving drinking um downtime so sometimes we need to just have an allocated time where we can just sit and stare into space or out at the bush or up at the sky and let our mind wander and then time in is learning to notice things like our sensations the images that come to our mind feelings and thoughts um so i used that model again both in physical and in our substance use and in mental health care very often um we're helping people who have both difficulties so i really try and focus on the person rather than the diagnosis for the diagnostic group and i think these models allow you to do that next slide please and um i based this on mike so i've said their quitting is a marathon and bill's pretty much already said the same thing so again i agree with everybody else that people need to make their own decision about harm reduction or abstinence and um no matter what we think we can certainly as particularly as doctors i think you should give health advice as heath to gave the example that people choose um now sometimes medical assistance is necessary and it can often be helpful it can be both so there are opportunities in prevention and early intervention as heath to mentioned just giving some health advice from your GP can help people you know get that little bit of momentum for change um medically assisted withdrawal may be necessary for someone with a significant problem for safety reasons and also because it makes it um more achievable more tolerable and there's a lot of supports and it's also been an opportunity for relapse prevention so somebody i think in the chat had raised a question about camcral a campersate and um that's certainly a medication um which can um help to reduce the risk of relapse heath to might want to speak more about that but essentially um medications we would use in the withdrawal process and then then there's basically two or three which we use regularly in Australia to help with relapse prevention they don't all suit everybody to have their pros and cons um and i guess coming back to a theme is that connection with other people a supportive network a community of peers friends family whoever you've got left unfortunately addiction can really strain those connections in my from the chair that i sit in working with people with substance use difficulties connection seems to be the key and doing a bit of family therapy with people um in a few cases where i've seen them you know coming back in time and time again and then when we've done that family work that's been the thing that's enabled them to make the changes that last that's all for me at this moment thank you Steve fabulous thanks so much Mary and thank you for touching on the the campersate question which did come up earlier let's now go to our discussion and i might just follow on from that because Mary's raised it Hesto do you have any thoughts about the use of medications at that point yeah absolutely so it's really important to know what you're treating um if somebody has physiological dependence so tolerance needing greater amounts to get the same effect and withdrawal symptoms so for alcohol withdrawal it can be quite dangerous depending on on how high your level of dependence is so people um become shaky they become anxious they can't sleep and if it's severe they can actually have convulsions or develop a delirium that's much less common but it's really important to get a bit of a sense of how severe that dependence that physiological dependence is because they need treatment for that so for some people if there's a bit of mild dependence maybe they'll be able to manage those first few days of stopping drinking or people might need just a little bit of benzodiazepine if they've got a very mild mild physiological withdrawal if they've got substantial dependence then they will need a very split structured program with potentially quite high doses of benzodiazepine we usually use diazepam or oxazepam but that would be in a controlled supported medical setting so I do out patient detoxes with people in their home um but that would be for people that are lower risk and I get them to go to pharmacy daily and pick up um the diazepam and it goes for five days and it's decreasing dose so it's very very structured one of the things that I see is people being given a script for 50 valium to do that detox at home that don't work I've never seen that work so really getting that level of support and structure to help people do that and they need to stop drinking and take the benzodiazepine for for the time that it is um described at most seven days no more once they've done the withdrawal then your relapse prevention medications have a role and there are three that we use a camprasate is one now trexone is one and disulpham is the other a camprasate does have a place um the issue is that it's three times a day and so that can be a bit tricky some people love it because they love the regimen to them taking the medication really helps them um the other one is now trexone which is once daily so it's a little simpler the one flag with that is you can't take any opioids because it blocks all opioids and the third one is disulpham or antibuze which does have a place and it does nothing until you drink and then it gives you a nasty disulpham reaction which people can end up in the emergency department so it is it does have risk and it's best used in someone where they've got good levels of support and they're followed up and it's really clear that disulpham is the right option for them there are a number of other medications that are sometimes used but they're still experimental so they do have a role but to my mind and both um bell and mary have mentioned this connection support really working on how you want your life to be your life goals your values once if you do have a dependence once you've done that detox those real shifts in how you live your life and the meaning that you have and the connection that you have are absolutely core to people maintaining change sure thanks for so that's great um i i'm actually going to use chairs prerogative and go to poor ol pauline enright in hobart who was complaining before about being cold her screen froze it's that cold so i think she's refreshed hopefully she's with us now i think i mentioned it's 37 here in the kimberley um but pauline's asked the question at what point is normal in inverted commas or social drinking in inverted commas considered to be a problem so where is the line between okay drinking and unhealthy or addiction drinking so i think mary you are going to comment on that and bill might have some thoughts as well look i just wanted to say i think it depends who you asked so again like what some sections of australian culture think is normal drinking is very different from others i think it's always worth knowing the n h and m r c guidelines around um safer drinking um and then this is where i think the you know the the diagnostic criteria for example for substance use disorder can be really helpful because there's no if someone meets those criteria then it is a serious health problem which there's no doubt in the mind of a doctor anyway that we we need to give that strong advice that this is a serious health problem um there is as i understand it there is an increasing um body of evidence that there probably is no safe drinking level in terms of optimising your physical health so even very modest levels of alcohol like seven you know about 10 standard drinks per week if that's chronically used and that is within the safe drinking levels probably doing things like increasing your baseline cortisol as i understand it which might be impacting your well-being overall so it's probably not what all of us want to hear but i think from a purely health stance probably almost never having alcohol is ideal i don't know whether history um whether we are others want to comment on that but i'll leave it there oh thanks mary bill do you have any thoughts on that i pretty much agree with mary first we'll start with the national healthy drinking standards um and discuss you know the implications of of uh using alcohol at those levels however to most of Australia those levels seem quite low and i don't i think there's a very large percentage of Australians that drink in excess of the national healthy standards uh and so you know there's an in-between period when when it starts to become evident i guess that there's a problem when their life when they are developing health problems and they are losing relationships or losing jobs or licenses um is clearly evidence that life is becoming unmanageable it is impacting on different domains in their life uh however as we all know some people in spite of all that will continue to drink but uh yeah look uh i personally don't drink at all and have them for a very long time but um i would suggest that uh certainly within the safe drinking standards if at all sure no i think that's a really good advice steve i just remembered i just remembered the old the old general practice aphorism that you're drinking too much if you drink more than your doctor that's uh that's becoming a real problem with this current state of general practice at the moment but we won't go down that pathway no politics tonight so can i just flag um something in addition to that totally agree with what everyone said but also just flag that there are specific times during people's lives when it is even more dangerous pregnancy breastfeeding um people that have got um other health issues particularly liver disease and also as you get older your body just does not cope with alcohol as well as it could so an older person in the 70s you know it may be in younger 80s you know that's having a few drinks that that can actually cause significant harm um and and i think you know there's a there is a real shift kind of happening in our communities with hello sunday morning and sober curious and those kinds of those kinds of movements and and young people are actually starting later in terms of drinking and a drinking list so there are real shifts and we have a larger proportion of people who are never drinkers um in our community so things are shifting actually hester costas has asked us the question along those lines about observing some um memory decline in somebody who's uh around about 70 and whether that could be alcohol related rather than being a demeaning process how do you tease those apart as a gb yeah absolutely i mean i think that certainly alcohol can cause um dementia in itself but even in someone who's not drinking at you know massive levels that alcohol can actually affect memory and one of the great ways to actually work that out is to actually to get someone to stop and see how their memory goes their sleep will improve their mood will improve and then memory will improve right thanks for that now there's been another really important foundational question asked by linness who's asked about um uh harm minimization versus total abstinence and in our case today the choice has been made for total abstinence but she's wondering if the team can think of any um indicators uh which might mean that somebody's more likely to be successful with a harm minimization approach versus a total abstinence approach um or is it really just their personal choice that we have to rely on i'd say if i might that uh it's largely hypothetical until they're offered for six months in uh well or or are successful in um quite a large reduction in their years you know if someone can go from drinking copious amounts of alcohol is causing them harm to having two a week well that's wonderful that's that's great um however yeah sometimes that's not the case and it takes a bit of practice and um you know i think it's a time uh it's a time thing most people will try and um and and the controlled um harm inversion and and and good luck to them and if they're successful that's fantastic if they're not well then they might decide it's it's really up to the client patient or whatever consumer at the end of the day anyway because you can't tell anyone or make anyone do anything it's when they decide that they can they can manage harm in or or they need to abstain um yeah thanks bill how that's useful it is any other thoughts from the panel on that one i mean i i his probably knows if there's you know research studies on this but i just for my observation i think that there are some people who really didn't have a problem with any substances and have sort of been had you know secure attachment and no particular mental health problems and um have had a series of stressors in their 40s or something like that and then fallen into heavy alcohol use um to me that that does feel different than someone that's kind of struggled with it you know for 20 years from their teenage years um and also i'd look at other types of um addictive behaviors as well um but i don't i i totally agree with bill i think that in the end it's it's it's a try and see and the person needs to be in charge of the choice it has just probably got some other yeah look look certainly um you know people do want to have choice what i find though is if somebody has a significant dependency of significant alcohol used to sort of like Mike they quite often will want to go for control drinking and they need to go on that journey and i go on that journey with them but they get to a point where they go you know what hester i just can't do this control drinking i need to stop completely you know and and i i will say yeah look i'm a little concerned that you might not be up to manage the control drinking but have a go let's let's have a go let's do it let's see how it goes let's support you through this and and then they'll get to that point so it's helping it's it's it's helping them by by supporting they have a go and sometimes they can manage it and somebody that's got a little bit of dependence they quite often can shift back to control drinking and marry those people that have you know very secure attachment have done very well but have had some some hiccups in their lives and have started drinking heavily they generally can switch back pretty easily because they've got that history um but you know absolutely you know supporting that understanding this is a significant issue and they will need support and it's not just a one time it's ongoing thanks hester and i must say that a question's jumped off the list of me from holly who's asked about the challenges of dual diagnosis working with somebody who might have perhaps the psychotic disorder who's using methamphetamine and somebody else mentioned maybe having a blood-borne virus and also a substance abuse disorder i gather we're sort of multiplying complexities if we're working with people who have other significant um diagnoses in their lives any thoughts about that well i i mean i this is the normal the normal patient for me and i actually think for a lot of general practitioners as well you know complexity is actually a very large part of what we see and i think i would i i always think about a formulation it's not just about a list of diagnoses it's about the whole picture of what's going on what's the context who is this person what is their life story um you know you know the old biopsychosocial think about occupational spiritual and cultural what's happening in the family um and and then think about it in a complex way and i think that complex problems often have complex solutions so there are often multiple different things that could help and i think in the end the things that are going to be the most helpful are the ones that the person themselves chooses with having said that obviously there are sometimes medical priorities so if someone is hugely at risk of causing themselves alcohol related dementia or um you know they've just had pancreatitis or um they have liver failure you know those those things are a kind of obvious priority but in terms of dual diagnosis i think about the the person rather than a list of diagnoses i don't know if that that's how i see it anyway okay thanks for that there are so many rich questions coming in i don't quite know where to start but there's one that has been given to us by Helen Baker who's asked about gender differences in this area and is reflecting on an observation that middle-aged women who have never or rarely or very minimally been drinkers appear to in some cases suddenly begin drinking heavily and can progress quite rapidly along that path i don't know if the panel has observed that is any any research evidence to support that observation yeah that's some really good research on the gender differences particularly with alcohol and what we know with women is that they tend to telescope as as that person said that they they develop the issue and develop harm very very quickly it escalates much more quickly and it's it's a different kind of dynamic that happens for women and there's a whole piece around being carers being mothers being good being good parent that is very different for women and the services that we have in place quite often don't actually support women in ways that they need to be supported so it is it's an area that we really haven't i think done very well in australia in lots of ways and and look they're men are more likely to have a substance use disorder than women but when women have one they really do suffer and they suffer early and they may present in quite different ways so they're more likely to present with mental health issues and we need to actually ask them about their substance use and really look at it from addressing the the the parenting issues and also connection and affiliation are really important in terms of treatment the other thing is we are seeing this in middle age ladies my age that went from not drinking very much to suddenly drinking and it might not be they're not doing that you know the 20 schooners but they're drinking a couple of bottles of wine you know so that's 14 standard drinks all of a sudden and COVID really unearthed a lot of this of people working from home starting to drink earlier getting stress there's a lot of stuff going on and and suddenly this this group of never drinkers or or you know social drinkers whatever that means you know who drinking very small amounts are now actually experiencing quite a lot of harm all right well thanks for that Bill any thoughts from you on that um look I would probably approach it the same way as everyone else what all I can really say is that I have witnessed it uh in middle age women and and it does seem to escalate very quickly like someone at 40 years of age who's you know may have maintained a house and a family and children and everything all of a sudden at 40 45 uh begins to drink and within five years they're very you know they're drinking lots and lots and it's impacting on their life in numerous ways you know detrimentally and do you have a different toolkit that you bring out when working with a woman compared to a man um no no same principles same principle you know deal with the person um and explore the background obviously a 44 year old woman who is uh just started or yeah hasn't been drinking long I'm going to explore the historical um life prior to before the drinking escalated what happened just prior to that was it a divorce was it some other thing that happened whenever I see uh an escalation in use I always want to know what happened just prior to that that explore that it may or may not have anything to do with it but yeah yeah thanks thanks for that yep so there've been a number of questions asking about the origins of this use of alcohol some people asking if there's a genetic basis that's been proved some people asking if there's an addictive personality type that can be recognized and documented I was wondering if the panel has any thoughts about that can we categorize people on the basis of having a genetic or physiological or a personality that leads them more into this sort of hazard look it's it's certainly very clear that if you have a family history of substance use disorder um that that increases your risk is it familiar or is it genetic is it modeling is it that that's the household that you're brought up in and that's how you have seen your parents manage their lives through the use of substances it's it's likely that there is a genetic predisposition but not everybody that has someone in their family who has problems with substances will have that so it's certainly an important risk factor but it's much more complex than that addictive personality I don't know Mary that seems not something that I would go for I'll leave that to you as the psychiatrist look I'm not I'm not an expert on this either but I I mean I think sometimes people find it helpful to identify that so there are some people that say I recognize my propensity to addictive behaviors and so therefore I'm really careful around that I'm not going to gamble I'm you know watchful of anything that gets out of you know out of balance um but it's it's not terminology that I use and I guess in the context of stigma I think it's always complex if the answer and listening to the whole story you know as all of us have said that that we would try to do to try and think about this this person and why are they presenting at this time with this particular problem or these problems there's often many things going on and I was taken in Bill's presentation by the mention of a lapse versus a relapse I was wondering Bill can you explain that to us and see if the other panelists have any comment on how we tell people about their lapse versus relapse well so just a lapse is is like a one-off return say if you were trying to remain absent from alcohol and and perhaps one evening you uh slipped and had two or three perhaps and then the next day was may be remorseful about it and wish that they hadn't that whereas a relapse would be a return to full scale behavior prior to their attempts at abstinence I think it's very and it's very important it can often be important to sometimes normalize the fact that people do have can have lapses particularly early in in recovery if they're trying to remain absent and that it's not a shameful thing and that the most important thing about a lapse is to identify what happened just prior to it so that when it happens again you can react differently however there there can be a tendency to some people if they do have a lapse they all bugger it I'll bugger it up now and and and head straight back into you know their historical behavior which is not useful and as far as the genetic tendency and all the rest of that I'd say it's a very very complex area and I don't think I don't think anyone will say that they know exactly you know that's what we've got a bio psycho social model and yes and you know at the end of the day it's it's up to the person to identify look sometimes it can be useful to help people put things in a container but I quite often in managing a park environment which is a you know prevention and recovery care we would have lots of clients that possibly could have been diagnosed with borderline personality disorder and we wouldn't we would say they had emerging borderline traits because sometimes it's not useful to to have a label particularly with young people because they can take on that label and make it themselves when it's not necessarily the case sure yeah all right thanks for that I see that all the talk has been about labels tonight that Hester's posting a link to a paper she's written on that which is open access so our participants will be able to have a look at that for a bit more detail as well and Hester one thing you said that made me put my ears up was about people sleeping better once they stop drinking the question's been asked by Sue about clients who say but alcohol helps me sleep nothing else helps me sleep do you have a response to that so like any psychoptic substance that is a sedative you do sleep but it's not normal sleep so there is a natural healthy architecture for sleep and and certainly yes when people stop using a substance they may have some insomnia for a period of time the question is is that actually an insomnia condition of itself is it related to their anxiety and their their depression there are the mental health issues because what we do find and it can take some time and this was something Bill pointed to is that once the alcohol as a sedative is out of the system you actually move back to your your normal sleep architecture and the quality of your sleep actually improves all right well I think that's a pretty good response so hopefully that'll that'll help see you out with that one we're at the point in the webcast now where we need to go around the group and ask each of our presenters just for a last comment and I'm particularly interested in how people go about collaborating with other professionals so Bill we should start with you because you started us off what does collaboration look like in your daily work who do you collaborate with in the course of the day well in the role of education that's mainly with industry in in engaging with various various industry practitioners organizations but as a as a practitioner myself it's it's fairly important to liaise with other organizations the person might currently be working with so if if they come into you for addiction and they're seeing a mental health professional despite our best attempts at integrated mental health and addiction treatment quite often is still seems a bit of a silo and so it really does make sense to liaise with the other practitioners so that we're all on the same page absolutely and Hester what about your daily work who who's on your speed dial oh everyone you look it really depends on the individual but the thing that I would say is we need a treatment team for you and that includes your counsellor your GP your mental health you know if you're seeing a psychiatrist or an addiction specialist your family or carers or the important connections it may well be you know your workmates it depends on the situation but it's really understanding that it's it takes more than one health professional particularly if someone has a significant use disorder that they're going to need they're going to need lots of support and it's going to be ongoing so it really is helping them to gather that team of people around them but to support them in their journey towards recovery right now I'm a little bit nervous to look at the chat box to see whether people are saying that there aren't such services in their particularly in rural areas it's very difficult of course when health professionals are in short supply in certain places but obviously the team is ideal and one thing an HPN can do is to connect people with other professionals in their area so you make best use of what services you have that's absolutely true all right so thank you for that Hester Mary final comments from you well I just wanted to tell a little story we had this meeting to prepare for tonight with all of us and Bill talked about the difference between lapse and relapse at that and I learned from Bill and so yesterday when a patient came in and she I hadn't seen her for a month and she said that she had a relapse and then she pulled herself up and she said no a lapse I had one bottle of wine and then I haven't done it again since and I was able to say I noticed that you just said lapse instead of relapse can you tell me more about that and then we were able to kind of celebrate the fact that she pulled it up and I just so my answer about collaboration is that I look for opportunities to learn from everybody and I you know I really love using exercise physiologists I value OT social workers psychologists mental health nurses my psychiatric colleagues I get a lot of second opinions working with general practitioners drug and alcohol counselors and I'm always encouraging clients to have their own support communities I think that community is so important fantastic well thanks so much Mary it's been a fabulous night for me the the the big thing that's been about terminology and that it can be damaging it can be incredibly empowering as well for somebody to be able to use even that simple concept of lapse versus relapse and to use that distinction as a way of giving themselves courage to run this marathon so that's been really really valuable thank you all so much I'll just finish up please don't leave everybody who's online because there's a few things we do need to talk about at this stage the you might have noticed it's got dark up here and I'm having trouble seeing my screen clinging into the light so please do make sure that you do the exit survey and provide us with some feedback there's the pie chart icon in the lower right corner of the screen next to the famous speech bubble so please fill out the survey or a message will pop up on your screen when the webcast ends so please let us know you also will receive communication from MHPN with a link to the recording when it's when it's been processed so you can share that with colleagues if you wanted to talk through what we've talked about tonight now the next webinar is navigating the mental health challenges when living with a physical disability that's in the 17th of October and also on October the 19th there's breaking the silence in the black rainbow queer robbery series what a fantastic word that is so the black label queer robbery series on the 19th of October at 1 o'clock breaking the silence then we have it's never too late to diagnose ADHD 7th of November and then emerging minds the sport supporting social and emotional well-being of children with higher weight on the 17th of November the primary healthcare network series says non-medical supports and programs for older Australians on the 6th of December so please keep an eye out for notifications when you can register for these webinars or look for upcoming webinars on the page on the MHPN website also there's a podcast out today in conversation with that's with Mirio Hagan and the amazing Dr. Ruth Vine who's our chief psychiatrist and an excellent human so that's part four and that's available on Spotify Apple podcasts or the website itself so the final comments are in the last minute that the MHPN networking program does support practitioners to meet and network with others from around their local community there are 350 groups across the country and around 30 have a focus on perinatal and a women's mental health be listed on the slide and MHPN will send you more details about these in the post webinar email if there isn't a network in your area why not set one up so you can do that by getting in touch with inner HP and through their email address networks at innerhpn.org.au or pop it in the feedback survey which we're all about to fill out there so before I close I would like to acknowledge the lived experience of people and carers who have lived with mental illness in the past and those who continue to live with mental illness in the present so thank you everyone on the panel for tonight and also for the participants for taking part I now have a locally called Baramundi to go and talk to you about being pan seared so thank you all so much wish you all the best for the evening thanks for joining us tonight goodbye


All right, we are really embracing midterm. So we got two people here, or sorry, reading week. So I guess people have started reading week early, but we still have some stuff to cover. So this is slash was going to be a fun lecture, but hopefully it's okay with two people because you'll have to help me out with all the coding stuff because a lot of it is just kind of free form. So today we will be talking even more about scheduling and page tables kind of as just review and a fun example. So we kind of talked about priority scheduling and dynamic scheduling, but we didn't see any example of it. So that's what we'll do and it matches up to previous midterm questions. So something like this is probably fair game for quizzes and stuff like that. So this dynamic scheduling where you dynamically change the priority of a process as you're doing a scheduling might also be called something like feedback scheduling. And you basically create an algorithms to manage the priorities for you. And otherwise your scheduling algorithm is pretty much the same as we saw before. So we use set time slices and the idea here is we have interrupts every so often within that time slice and we measure CPU usage across that time.  And then we decrease the priority of processes that use their full time slice. And the idea of this is to give essentially priority to IO bound processes. So you have good responsiveness while still giving being fair and giving CPU bound processes a lot of CPU time so you have good throughput still. So we pick the lowest number as the highest priority kind of what we've been seeing before and what Linux does. So each processes gets assigned an initial priority when it starts. So PN where N is the process number. And then we're going to pick the lowest priority number to schedule. And then if it yields we pick the next lowest number or if there's a tie we pick whatever came first in arrival order. And additionally if a lower priority tasks not even with this current running one becomes ready we would switch directly to it and just switch directly to it and let it execute until it yields or it's done its time slice. So then within the time slice we record how long each process executes for the time slice. And in this there are many timer interrupts during the time slice. So a time slice will be a multiple of timer interrupts. So you basically just count the number of timer interrupts that that thread or process whatever you happen to schedule is actually executing for. Then at the end of the time slice you update the priority of each thread with the. So the new priority is the current priority divided by two plus whatever the value however many time slices you were executing for and then you just reset the time everything is executing for back to zero to keep track of it for the next time slice. And the idea here is that, hey well this is fair because we're essentially halving the priority so that will converge to zero and this case zero is our highest priority. So we know eventually that it will run and you could of course play with these numbers to get kind of different trade offs but this is kind of one standard trade off you would do. So this is how it would look and this is like the midterm question or final question. I forget which one it was but it says, hey we have four processes and let's assume they all have a initial priority of zero. Actually the midterm doesn't say that you have to assume the initial priority is zero or you can assume whatever you want. There's two answers. So we'll first assume a priority of zero. So the question says, hey assume we have four processes all ready to execute and they arrive in order X Y A B and the question doesn't say what the arrival order is but it should have. So between those four processes A and B are CPU bound processes so they'll never yield their CPU time or do anything like that and X and Y are IO bound processes so they'll only execute for 0.1 seconds and then they'll block for 0.5 seconds. Then the question says, hey okay so we have timer interrupts every 0.1 of a second and then each time slice is a full second. So if you divide those two numbers each time slice is made up of 10 timer interrupts that we have to keep track of. So in this question it says what is the scheduling and each box here represents a timer interrupt. So what's gonna be the first thing we execute if they all have the same priority number and their arrival order is X Y A B. Anyone in class? X, right? It's the first one that arrived they all have the same priority number so you just tie do arrival order. Yeah, we got X in chat, we got two Xs, lots of Xs. So we'd schedule X first so it only runs for 0.1 seconds and then it yields and would block. So after it's 0.1 seconds after the next timer interrupt we would switch to the next task because this one would be blocked. So what would we switch to? Y. So we would switch to Y and Y would execute for the next time slice. Now Y is done and we have to pick a new process to schedule. So what should we pick? A, how long is A going to run for? So A could either run all the way to the end of the time slice or X here went to sleep after the first time slice. So it blocks for 0.5 seconds. So within five time slices after X goes to sleep it would be ready again. So if we assume that, hey we should just schedule that because we should just schedule that because it is a high priority one. We would go ahead and schedule X when it wakes up but in this case it's not higher priority. So whenever X becomes ready kind of at five timer interrupts after it goes to sleep we wouldn't schedule it because it has the same priority as A so we'd only schedule X in if it had a higher priority. So in this case A would just execute for the rest of the time slice because they all have the same priority and it was already executing so by the time X becomes ready it's going to, yeah when X becomes ready at time six we don't switch to it because it's the same priority as A so we're not gonna switch to it. And then similarly at seven Y is ready because it just blocks for 0.5 seconds but we don't again don't schedule it because it's the same priority as task A so we wouldn't bother scheduling it. So at the end of our time slice which is at T time 10 we would recompute the priorities of everything. So the priorities of X is, its current priority is zero so we divide that by two, get zero and then add however long it executed for in terms of number of timer interrupts. So it executed for one timer interrupt so it's new priority is one, process Y, same deal it also executed for one timer interrupt so it's new priority is one and then process A executed for eight so it's new priority is eight and then process B executed for zero so it's priority is zero. So at T 10 we get to schedule something else what are we going to schedule to execute? B is the lowest priority nothing comes close to it so B is just going to execute for the entire rest of the time slice so this is what our schedule is going to look like it would just be X, Y, A and then B for the remainder of the time. Okay, so let's do the same thing except now A and B have an initial priority of six and X and Y's priority are zero so if we have this case well X and Y have priority zero A and B have priority six so at the beginning what are we going to schedule? Again, they're already in the same arrival order X again, right? It was the first one there and it's also the lowest priority it's tied with Y so between X and Y, X came first so we'd schedule X then X yields and blocks for 0.5 seconds so we don't have to worry about it until the end of the six time slice so then we would execute Y and then it would go to sleep now instead when X becomes ready because it has a lower priority we would switch back to X from A so now A would execute we'd pick A because there's a tie between A and B so we'll just pick A and now at T6 X becomes ready and because it has a lower priority we would just go ahead and immediately switch to it so now we immediately switch to it we immediately switch to it and then at the end of the seven time slice Y becomes ready so we would switch to it because it is still a higher priority than A or B and then they're both blocked at that point so the only thing we can schedule is A or B and we still pick A then at time 10 so the end of the time slice we recompute the priorities again so X and Y had an initial priority of zero so zero divided by two plus however many timer interrupts that they were executing for so the priority of X and Y are going to be two the priority for A is going to be six divided by two which is three plus six so its priority is nine and then process B is going to have a priority of six divided by two which is three plus zero so now at this point we have to pick something to schedule again so what are we going to pick to schedule at this time instant at time 10 so X we got an X and a B so in this case X we can't schedule because it is essentially asleep until one, two, three, four its back like here so X isn't scheduleable Y is not scheduleable and between A and B, B has the lowest number so it's a higher priority so we'll go ahead and execute that for two time units and then after that X is ready again and X still has a lower priority than B so we would switch to X and then Y becomes ready and then for the same reason we would switch to Y and then after that we're between they're both blocked so now we just have to pick between A and B and we would pick B again so B would execute for another four timer interrupts and then X is ready again so we'd switch back to X and then switch back to Y and then this is what our schedule would look like any questions about that? Nope, we're good okay so this would be a little bit of a different question if A and B had priority of four instead of six in which case I guess I'll leave it up for you to argue about but if A and B had priority of four instead of six then B would execute for this entire time slice because it would have the same tied priority as X and Y so you wouldn't switch to it when they become ready. Okay, any questions about that? Cool so I guess before we get to the fun stuff oh yeah so the question is how does this how does this work with setting the number manually and just static priorities? So this is dynamic priority so that's it's just a different algorithm so you can initially set the initial priority but the algorithm will dynamically change the priorities so you get kind of good interactivity with IO bound processes and more throughput with CPU bound processes okay so another thing we could do another question that's on the midterm for this same schedule as A what if it was round robin so we can do that really quick so if this was round robin instead we would have initially we'd have X, Y, A and B so we would schedule X and then at the end of it's it would go to sleep after one time or interrupt so it would be so it wouldn't be scheduleable so our Q would look like this Y, A, B so we would schedule Y and then whenever we schedule Y what's in our Q is A and B so this is round robin so we're just picking whatever is at the front of the Q so then we would schedule A and then at the end of that whenever A is done so this is round robin and you're just going to change every timer interrupt and just go through all the processes so A would execute for one timer interrupt and then it would be sent to the back of the Q because it's still able to execute it doesn't block or anything so you'd get X, Y, A, B and then here you would have A, B in your Q so you would have A and then again you would have B, A after that then you would schedule process B and then at this point right here X is ready again because it's been five time units so what we always do is we put B, whatever task just gave up its time unit if there's any ties we put it at the very back so right before when X is ready our Q would be A because it was still in the Q before and then after A would be X, the newly ready one and then B would be after that so at T7 we would schedule A and then our Q would look like X, B and then at this time unit Y is ready again so when Y is ready again we would throw it at the end before we reschedule B or A at the end so now our Q would be X, B Y, A so we would schedule X it runs and then it gets blocked so now our Q is B, Y, A we would schedule thread B then we would have Y A, B in our Q and we would schedule process Y and this would go on and on like this for the question has you do this for another time unit but it's going to be the exact same thing so it's just the exact same thing but longer alright and that was round robin show any questions about that before something hopefully more fun okay so more fun so Wilkes-War multi-level page table is live and there's only like four people here and three in chat so hopefully this is okay so I essentially just wrote an MMU simulator and if you want to play with it yourself you can go into this lecture 23 directory in your in your examples and just build it using those commands and there's an MMU sim command so let's go ahead play with that a little bit so so here is our MMU simulator so right here we would so how the MMU simulator works is it has a root page table and we're going to assume that SV39 uh... kind of multi-level page table format and we will resolve all the uh... virtual memory addresses there's this function that says allocate page table allocate page table will return you a page so it will be four kilobytes and then you're free to do whatever you want with that page so first we allocate a page that we're going to use for our L2 page table so that's our highest level if we're using SV39 and we would set that to our root page table because essentially our MMU is just going to use the root page table to go ahead and resolve whatever the virtual address is to a physical address so we set the root page table to an empty page so none of the entries are valid none of them point anywhere if we tried to resolve anything just using this as a root page table they would all be page faults so what we're going to do is try to resolve the address a-b-c-e or a-b-c-d-e-f so if we want to craft our page table and actually make it resolve to something so let's try and make it resolve to cafe-d-e-f so if we do that then so how we do that is if our address is a-b-c-d-e-f well this part because it's SV39 this would be our 12 offset bits because remember each hex character is four bits so three of them is 12 bits which is the size of our page so this would be our offset so whenever we're translating we don't touch those we'll be translating a-b-c to essentially point to some physical page so if we want to know what index is to use well unfortunately there's only nine bits not eight so it's easier if we just write it out in binary so if we write a-b-c out in binary starting from the end it would be 0-0-1-1 because this is c as it is up there b would be 1-1-0-1 which would be b and then a would be 0-1-0-1 which would be a and then everything else would have zeros appended to the front so it'd be like zeros so we just have a bunch of zeros for the remaining numbers so if we divided up and then remember because all of our index bits in this are going to be nine bits so if we take a group of nine this is our index for L-0 because it's the lowest nine bits and then if we go ahead and count the next nine bits one two three the next nine bits would be here and this would be index of L-1 and then one two three so one two three so all the other padded bits up here would be the index of L-2 so if we want ABC EDF to resolve to a virtual address we know what indexes we have to use so if we convert index L-1 to back to just decimal so we can read it that one is a four it's four plus eight plus sixteen plus thirty two plus what's that one twenty eight and if you add that all together it is one eighty eight and then for L-1 our index would be one plus four so we need to have an entry at index five and then for L-2 it's just a big old zero so if we want to resolve this so we want to resolve this is our virtual address here say we want to resolve it to physical address C-A-F-E and then the offset would not change so it would look like this so now this is our offset we want to resolve it to that so in that case we would need to have our L-2 page table which would be our root page table would need an entry at index zero so we'd need a valid entry at index zero and it would need to point to a L-1 table now if we want to resolve this we need to make sure that there's an entry at index five so there must be an entry at index five that points to an L-0 table and then in the L-0 table at index one eighty eight then we want the physical page number because that's our lowest level so we're going to use that for translation so instead of pointing to a page we know that it would point to a physical page number and in which case if we want the address to resolve to C-F-E then the physical page number would have to be C-A-F-E everyone agree with that? so let's do that then so that's exactly what I do so I allocate page table just gives me a page and because it's a page table and I know I'm using it as a page table I don't have to worry about offsets within that because I'm essentially just using the index to get the using the index because I know how many entries there should be so for the L-2 page table I make an entry at zero and I make it so P-T-E from page table all that does is essentially grabs so the page table is a page so all that allocate page table guarantees that the last three hex digits are all zero zero zero like it's all aligned to a page so P-T-E from page table would just essentially just get the physical page number from that and in the P-T-E one of the bits says that it's valid so that's all it's going to do so P-T-E from page table essentially just gets the physical page number of the page table and that's just shifting by the number of offset bits so we're just getting rid of the offset and then that's our physical page number and then if we have a physical page number well if you look at the format of a page table entry there's ten bits that are meant for all the permissions and everything like that so we just shift it by those ten permission bits uh... the physical page number by the ten permission bits and then we set the valid bit so we for this we're only going to care about the valid bit a real implementation we actually care about like read write execute things like that but we'll just set the valid bit which would be bit zero if case you're interested in this return the page table entry so so we create an L2 page table and then we create an L1 page table and then we make sure that index one of that L2 page table points to the L1 page table that we just got back in this case from the kernel or the operating system or whatever gives us our pages after that we need an L1 or L0 page table so we need an L0 page table so we'll allocate another page so now we have three pages and then we're going to make L1's entry for five point to the L0 page table in the same way we made the L2 point to L1 so we're going to do that and then in the L0 page table that's where we put our entry in the right spot so again we said that should be an index one eighty eight so if we get the page table entry so if we get the page table entry that represents cf cfe c-a-f-e then that would be able to go ahead and resolve in the MMU whenever it does a translation so if we use the MMU now with the root page table so it's just going to use the root page table and follow it around if we go ahead and use that now when we actually run this we should see that a-b-c-d-e-f resolve to c-a-f-e d-e-f okay so that's cool it works so what if anyone tell me what this might resolve to? will this resolve to an address or be a page fault? yeah yeah I just changed it to zero yeah yeah I just changed the last hex character of the address to a zero instead of an f okay but I'll still get a physical address and it'll look kind of like that okay so we have a page hit the physical address is going to be mostly the same but just have that change everyone agree okay so if we compile that yeah so if I do that it would actually resolve because I'm just changing the offset the virtual page number is the same I'm using the same root page table so it's doesn't have to do anything special if this was this would actually be as well cached in the TLB so it would have this translation already so if I access anything on the same page it's the same translation so it wouldn't translate it again which is what we saw before and it doesn't matter if it's anything on the same page it would still resolve so ABCD or ABC zero zero zero that would still resolve to the same address or the same physical address there would be an entry there okay well any questions about that so the question is does the page table stay in the same memory space as the programs so the page tables would be in kernel space so the processes aren't allowed to touch them so the kernel manages all the page tables in this I'm just kind of simulating it but in the real kernel the kernel is the only one that it can swap the page tables so essentially the kernel is going to manage all the page tables and then when you swap processes you'll swap it'll swap this root page table and then that will essentially switch address spaces so so the MMU is just doing the translations so that so the MMU is part of the CPU yeah so the MMU all of its job is it's on the CPU and all its job is to resolve virtual addresses to physical addresses and then the CPU would go ahead and issue whatever memory stuff it needs to do okay well in this case I'll leave this to you then so say I'm just going to access address 7 f f f f f f f f so if I try to translate address 7 f f f f f f f which is essentially all that is is all 39 bits are set to 1 so all 39 bits are set to 1 and right now if I compile that and run it I would expect to have a page fault because I don't have any translation for it so it would so if I run that I get a page fault and why because first it's going to look at the root page table anyone want to tell me what index spot it's going to look at in that table 7 f f so 7 f f is 7 f f is too many bytes it is 11 bytes or 11 bits so if everything's a 1 and all of our indexes are only nine bits it would be 1 f f which would be it's looking at index essentially the last one which would be 5 11 so first access is going to be the index 5 11 and it doesn't have a valid entry in it because we didn't put one in it so it's not going to result anything so we're going to have a page fault immediately so if we wanted to we could create another l 1 page table oh yeah okay check out it too there we go so if we create another l 1 page table well we create another l 1 page table and then our root page table is that l 2 page table so l 2 page table if we want to start resolving this we need an entry from 5 11 and then it would point to our l 1 page table 2 that we just allocated so now it's pointing to a new one again this is still going to be a page fault uh what the hell they do oh whoops pte from page table so i have to put in the right format sorry so this is still going to be a page fault because i resolved the first one i swapped to i made it to an l 1 page table but then that didn't have an entry so i couldn't resolve it but i got a little bit closer even though the end result is i still have a page fault so i need a l 0 page table for this now so if i have an l 0 page table then my l 1 page table that i just made needs to have an entry of 5 11 that points to the one that i just made so pte from page table l 0 page table 2 so now it's pointing to the new page table i'm a step closer because now i've resolved two levels of page table but now in that new l 0 page table there's no entries so again if i go ahead and compile it and then run it it is not it's still going to page fault so the way to get it to not the page fault is i need to make an entry in my l 0 page table one uh of again my index is going to be 5 11 and i would need a page table entry from physical page number what physical page number do i want to use anyone with any suggestions this could be anything any fun numbers what about uh that's fun so if i do this and compile it now yeah we got beef we got dead beef so if i compile it right now what am i going to see 7 7 7 f f f f f get or sorry just 7 f f f f f f get resolved to yeah so it's going to be dead beef so it's going to be dead beef and then i'm going to use the same offset there so the same offset in seven seven or seven f f f f f is the last three digits so i'm going to get those three so i'm going to get dead beef and then three extra apps at the end so i'll have a total of four apps so if i run that i go ahead and i resolve it to dead beef so yeah any questions about that or anything other things you want me to do so so yeah you can see here two kind of different scenarios and how many page tables you might need to have to essentially translate some virtual addresses so best case with three page tables so if i only have three page tables i can translate up to 512 virtual addresses if they all fit in that l1 table if it's all full if i was unlucky well then i would have my one root page table but for those you know say i had 512 page table entries again i could be unlucky and they're super spread out so if they're super spread out that means all of my l2 page tables my l2 page table would be full of entries and each would point to another page so it would point to 512 pages and then each of those page tables would have to point to an l1 so there'd be another 512 pages and to resolve and then each of them would have a single entry so that's kind of best case i would to translate 512 addresses i would need three page tables and then worst case i would need one plus 512 plus 512 so i'd need was that 1025 page tables to translate all the addresses all right any other questions well i'm here and you can play with this because i virtual memory is like the hardest thing to wrap your brain around so let's see so here two if i wanted to well if i want both of those virtual addresses to point to the same page well all i would have to do is so say i want both of my virtual addresses assuming they have the same offset which they don't so let's change this one so let's make both of our things have the same offset so if i want them to resolve to the same physical address because they have the same offset all i do is make their page table entries point to the same thing and then when i compile it and run it they're going to resolve to exactly the same address so i would have two ways to refer to the same memory location so essentially i'm sharing pages this could be done in the same process it could be across different processes it's up to the kernel to the side and manage all these page tables and yep this is all on github so you can play with it and understand it all right nothing else so thanks for the people that showed up today so uh just remember i'm pulling for you