The following is a presentation of TFNN. The morning markets kickoff with your host Tommy O'Brien. Good morning everybody. I'm Tommy O'Brien, coming to you live from TFNN Wednesday morning, 9.06 a.m. We got about 24 minutes to go until the start of trading and we've got markets pulling back just a bit this morning. You got the S&Ps off half a percent. We're trading down 22 points at 44.82. You check out the acceleration we've had man, 48.08. That's the high on January 4th. The market sells off. We make a few lows right near the area of 41.30. You're down to a low of 41.01 on February 24th. You touch an area of 41.38 on March 8th and you get down to 41.29 on March 15th. And then man, you talk about a pop over the period of basically four, we'll call five trading days, five out of six. You had four huge days up. We take a pause. Yesterday, we accelerated as well. You have the S&Ps reaching a price level of 45.14. Folks, you're talking about more than 9% in five, six trading days. 9%, I think it was 9.3% was the number. Staggering pop in this market, don't be surprised if you give back some of that action to the downside when you get a 9% to 10% pop over four or five days, folks, my goodness. Jumping over to the cues. You talk about a move. Cues are up like 13%, I think. Now the cues have not opened yet. They're going to open at about 354, so we don't have that on the chart yet. But you're talking about trading from a price point, folks, of 317.45 and I think we're even a little bit lower in the pre-market. Yeah. So if you take it from 315.71, you run it up to the 357. You're talking about 13% in the NASDAQ 100. Did you hear that? Let me just make sure it is. All right. I'm going to take the high there. 357.85. We're going to subtract the low. 351.71, that gives us a move of 42.14 points. It sure is 42 points off of 315.71, 13.35%, folks, 13.35% just by buying the cues early yesterday, Tuesday, and closing out the action yesterday, just remarkable in that index. But we've seen the pop. We've seen the acceleration in both times. You know, you get moves lower. You get a bounce. It's going to be big. You get a 13% bounce. Yes. You may get a pullback as well. Bitcoin. Cryptos. Yesterday. Bitcoin up to 43,490. We're basically flat this morning. Ethereum inching towards 3,000. We make it up to 3,062 yesterday. We're at 29.69 right now. Crude continuing to climb. We're up right near the highs of early yesterday. Look at that action. Yesterday we make it to a high of 1,1335. This morning we touch a high. Come on. 1,1353. So just above the high we had early yesterday. And remember, man, you talk about some volatility, yeah, you dive from 1,13 and change to before we even opened the market yesterday. You had a 10710 print on Crude and just like that, we're back to 1,13 within the span of about just over 24 hours of trading. We jumped to gold, catching a little bit of a bid. Gold up $9 at 1931. You see the action though. Just kind of chopping around at this price level between about 1,900 and maybe about 1,950 since about last Tuesday on gold. You jump over to notes and bonds, a little bit of a reprieve from the action in notes and bonds. Now check out the move in notes and bonds. Talked about it yesterday. But man, quite a dive, $3,514, right? You were already in a downward channel in terms of lower price and higher yield. And basically the market said that channel is not steep enough. We need negative action in price because yields are spiking. Absolutely remarkable, folks. When you talk about where we were, I think it was March 4th that we had a print on the 10-year. It was probably the weekend from March 4th over to March 7th. I believe you had a print on the 10-year of 1.698. It was barely a 1.6 handle. We'll just call it 1.7% because that's basically where it was approximately at. We're sitting near 2.4% right now, folks. 1.10% in under three weeks almost. Just a remarkable move. Don't be surprised if you get a little bit of a reprieve here in notes and bonds as well. We're not just going to run to 3%. It's not going to happen right now, folks. You're not going to move from 1.7% to 3% in the span of a month or two. It could happen. This is my take. I imagine you're going to get a bounce to higher price and lower yield, get back within this channel line. It's on the daily folks. You can put it on your charts. Very simple daily. There's your acceleration from 1.35 to 1.14%. We're sitting at 1.20 to 2.28 right now. Even if we get a bounce, don't fall trapped to that bounce, folks. It is lower prices. Even if we get back within that channel line, I imagine we're going lower. Lower price, higher yield. Coming at you in a big way. We jump over to the VIX volatility index for the first time in a while. Let's put this back on a daily going back to we have the COVID highs of 85, 47. Talk about remarkable. To take that out of the chart, though, many, many tops since then as we've had some volatility, looks to be finally sustaining a dive to lower prices in the VIX, man. We were spiking near 35. We were spiking near 37.50. Finally, we have a sustained level. Whoops. Let me back that out. Zoom in on this action right here. Finally, we have a sustained level given up that acceleration. My expectation is maybe we dive back to about the 20 area. We still got way too much volatility to get back below that area at least right now. Possible tensions, rising wages, supply chain issues, inflation, et cetera. All of that keeping the VIX in an elevated level. But since you've seen the market, right, think about it. We have the S&Ps up 9% over the last five or six trading days. We have the NASDAQ 100 up 13% over the last five or six trading days. And still the VIX is sitting at an elevated level of 24, 24 on that VIX. All right. Let's jump around to some of the action this morning. We'll jump around to Adobe. They have their numbers trading a little bit lower. We jump into the action on Adobe last night. Adobe trade tire with the market, 471.98 was the high. We come into the close at about 466.45. You dive lower and we're right back near the lows of that acceleration. You get the market trading lower too. That is not going to help a company that misses on earnings. Adobe down to 447.25. So far this morning, S&Ps down 25 points right now, Dow down 170. As I mentioned though, folks, you just got to back it up on a 10-day chart in a 30 minute. Can you even see the pullback? We got the S&Ps down 6.10% right now and we are barely, barely off of the highs that we made yesterday near the close of 45.14. All right. Let's jump around to some of our fang stocks and see how they're kicking things off as we come into the first break. We'll be coming back, talking to our man Kevin Hinks from TD Ameritrade Network, Fast Market. We'll be talking to our man Teddy Kegstad coming up at 40 past the hour. We'll be talking some crude. We'll be talking some forex markets. Always an interesting conversation, especially so now with these crude markets and just the geopolitical everything going on across the globe as that forex market, especially important right now with everything so in flux. Amazon shares, barely in the negative this morning, down about $20 at $32.76. Tesla had quite a day yesterday, right? Accelerates to $9.97.86, couldn't quite hit that $1,000 mark. You're back to $9.79.50 on Tesla this morning. We jump over to Google shares, I mean, all these tech stocks, man, just charging higher in a big way yesterday. I think Google was up 2.4%, something like that. Trades from about $27.30 up to $28.30, $100 rise, settles near $28. We jump over to Microsoft shares, Microsoft, barely off a bit to $301. We jump to Apple shares, Apple, talk about a move, man. Take a look at Apple. The full run from back in October to the $3 trillion mark of $182.94, some real volatility here, man. Let's talk about a bounce. Again, Apple's got 16 plus billion shares trading, folks. Every $10 is about $165 billion in market cap. Since March 15th alone, eight days ago, Apple's market cap has risen by more than $300 billion with a B, billion dollars to put that in context. But we're right back up at this recent high at March 3rd. Stay tuned, folks. Right back with Kevin. Everything in the universe is governed by the Fibonacci sequence. This mathematical principle is responsible for everything, from the most aesthetically pleasing artwork to patterns in the stock market. To stay on top of stock patterns you can take advantage of, sign up for the Fibonacci 24-7 newsletter at tfnn.com. When you subscribe, you'll get a weekly report from Veteran Day Trader Larry Pezzavento on stocks you need to pay attention to, and you can trust Larry's analysis. After all, he's got 45 years' experience as a day trader. Larry will also provide daily charts, videos, and data on the key markets that he's tracking. Expect notifications from Larry on market movement you need to act on at any time. First-time subscribers also get a 30-day money-back guarantee. If you're not satisfied, let us know and you'll get a full refund within 30 days of signing up. Subscribe to the Fibonacci 24-7 newsletter today at tfnn.com, educating investors. It's separating you from the most successful men and women on Wall Street. That's right, information. Having all the information gives us the perspective we need to place the right trades at the right time. The TAS Profile Scanner is the premier market-profile-based scanner. Powered by its acclaimed TAS proprietary algorithms, this feature-rich scanner instantly filters over 2,500-plus global financial markets, such as stocks, ETFs, commodities, futures, and forex. This powerful suite of tools leverages instant trade filtering and strategy formulation to show you emerging trades before they happen.  Level the playing field with the TAS Profile Scanner, which you can find under the Services tab at tfnn.com. Sign up today! Sharpening your skills as an investor is like getting better at playing a musical instrument. You have to practice, sure, but you also need excellent instruction from experts. At TFNN, you'll get advice and guidance from the authority and technical market analysis. And it's not just dry, tedious text, either. TFNN airs live financial content streamed live on tfnn.com and TFNN's YouTube channel with Tiger TV, live every market day from 8.30 a.m. to 4.00 p.m. Eastern, for free. Each host is an experienced trader and gives their take on the market while taking calls and questions live from around the world. From the moment the market opens until the closing bell sounds, Tiger TV has eight different shows with expert hosts to help you make the right moves with your money. Search online at tfnn.com or on TFNN's YouTube channel and become the investor you were born to be, TFNN, Educating Investors. Welcome back, folks. We have the S&P's right now, negative 24 points on the session. We've got about 12 minutes to go until the opening bell. Let's jump over to our man, Kevin Hinks. Every trading day, folks, on the TD Ameritrade Network Fast Market with your host, Kevin Hinks and Tom White, 12 noon Eastern time right here on Tiger TV. They break down the day's market action. They walk you through, folks, talking about hypothetical trade setups, talking about the thinkorswim platform, all right, you're talking defined risk. We got a VIX right now, sitting right near 24. We got the S&P, folks, popping 9 plus percent over the last six days. We got the Qs popping like 13 percent. You talk about some volatility in this market. Kevin Hinks, good morning. Good morning, Tommy O'Brien. Well, here we go. The same script that we've had for the last couple of days here is a soft opening, you know, the last several days it's open red, firmed up and then turned green as the day went on. We'll see how today brings, obviously, we don't know what today brings. We just gave some of the questions. The answers will be what happens in the actual market, but you got a number this morning out of mortgage apps that isn't really surprising that it was a soft number based on what interest rates and yields have done in the last week or so. That's a big number, purchases down 14 percent. So Jerome Powell speaking this morning, let's see if he continues his hawkish rhetoric or he calms it down slightly. Not a lot of top-tier economic data will get some durable goods tomorrow morning. That'll be our main data point of the week. We're near the end of earnings, so we don't have much going on there. Some good names, but not much. But we'll see if the script for the last several days plays out again today, Tommy. So in general, Kevin, when you look at a market like this, as due in the math last night, and I had to check the calculator twice, man, because I said, really, the queues are up like 13 percent, man, since early last Tuesday. Obviously, very tough to chase sometimes when you get a move that magnificent over an index especially. We know equities can move, man, but even an index that is so heavily weighted to so few like the queues, 13 percent, even the S&P 500, Kevin, popping 9 percent from those lows early last Tuesday, barely a week. What do you look at as an investor, as a trader, when you get that type of a rise? I mean, I look at the action this morning, it's down 25 points. You know, I say, of course, you might get a pullback, man, the market's almost up 10 percent from where we were just a week ago. What's kind of, what do you deal with?  Well, does it have to? The answer is no, it doesn't have to, but you know, the big question out there in investors' minds right now is, is this type of a bear market rally that should be faded or is this that now that the interest rate uncertainty is beginning to come more certain? Is this a green light to buy these tech stocks? Remember, if you look at the market yesterday, Tommy, it was a who's who of tech stocks and large cap stocks. It was the Amazon and Tesla in consumer discretionary. It was all the major names, Facebook, Google Alphabet, all the big names were up yesterday. So the leadership yesterday was fabulous in terms of looking at the overall market now. How does that play out in the next couple of days? I wish I knew that, Tommy, I have no idea. We'll certainly trade them up and find out. That's for sure, man. I know. Talk about the million, not even million, the billion dollar, if not trillion dollar question right now in this market, Kevin, Apple. And you said, man, the leaders in the market, just so much strength. I pulled up the numbers, man. Cues were up over 2 percent. I said, whoa, and I hadn't quite looked at all of those big fang stocks. And yeah, they were all up, just staggering. 2 percent, man, 2.08, 2.4 percent. Apple alone, Kevin, just from where it was on March 15th, you're talking about adding about $300 billion in market cap, man. Not many, not sure how many companies are even worth $300 billion. Not many, but that's what they've added since March 15th to their market cap. Of course, we come into already, Kevin, the end of the month right now. And it all kind of starts already again next week as in not far. We get the end couple weeks after that. We're going to get CPI data for the month of March. We have some time in between then. And as you said, man, the market, talk about accelerating in, pricing in those rate hikes when we have a 10-year yield going from about 1.7 to 2.4 percent. Can you give us a little teaser, though, of what you're going to look for when we come to, of course, we're going to be looking at jobs, but wages importantly. And then we've talked about it last time when we had the CPI, right? In terms of, I think your term was video game numbers, when we see those numbers from March. Is the focus going to turn to the core number for the Fed, Kevin? Are they going to try and say that maybe gas prices eventually were subsided and they're going to focus on the core? What do you think is going to happen to the conversation? And again, they're big questions, man. But I'd just love to get your insight on how that number is going to get talked about when it's going to be a big number, man. Oil is still this morning trading at 1.1362. We all know gas prices are approaching video game numbers to put it. What do you think is going to happen when we get these type of numbers coming up in the month of March next month? Yeah, I think that's a great question. And the question is, where will the market focus its attention when we start getting inflation data for next month? Now, remember, Tommy, a month ago, we got a flat, an unchanged, a 0.0 wages monthly data. So that was interesting. Let's see the weight. The first look we'll get at inflation is in the wages data. Come out the first week in the non-farm payroll data. We'll see what that'll start us off with a look at inflation. And then when we do get the CPI numbers, how are they going to look past that headline that will probably be something in the silly area? And do they go back to the core, the ex-food and energy and for inflation? And that'll play out over time. But it'll probably, you know, I love to look at the charts when the CPI data comes out. And so see what sectors of the economy were really blowing up. A month ago, it was all energy, Tommy. It was big numbers in energy. I don't expect that to change very much. But the market rallied on that because it was all energy, if you remember. So we'll see when these numbers start coming out. But I'm sure the expectations for the next CPI number are going to be silly, Tommy, to put it lightly. It's so cool, man.  Is the core number going to get the attention? But then the next thing my head goes, well, does that make sense? This is the market going to say, hey, just take food and energy out of the equation right now. When food, Kevin, itself, we all know is just, man, the grocery store is just pretty highly priced these days. That is a core component as well. It's not a core component. But in my household, man, that's a big household. You know, when you got kids in the household, as we all know. What are you guys talking about coming up on the show at 12 today, Kevin? Three good names to look at today. In the eight block, we'll look at John Deere, or Deere and Company, as it's known now. Then we'll look at Marriott Hotel Change, or kind of a reopening play. That's what, like, Folio will discuss. And then we'll look at an earnings play in Darden Restaurant, D-R-I. That is the owner of, as you know, Olive Garden, Capitol Grill, Season 52, good restaurants like that. So a large restaurant chain coming out with earnings today as well. Season 52, a little well-known restaurant, one of my favorites, a healthy restaurant, but upscale. And I'll give you a little anecdotal, Kevin. We were just at Marriott this past weekend for my birthday. There you go, man. We're people getting back out and about. John Deere, man. I can't wait to hear you take on that one. Talk about an acceleration from 330 to 430 over the span of no time. Kevin, thanks for the talk. The education. We'll be watching at 12, man. Have a great day. Have a great weekend. Have a great day, Tommy. Thanks for having me on. Are you having fun trading the markets, but having trouble finding like-minded individuals to discuss your trading and investment ideas with? Become an Apex creditor in the trading markets and join the Tiger's Den Trading Room, only at tfnn.com. The Tiger's Den is an exclusive trading room where successful traders from around the world come to exchange trades and ideas. Join the den and surround yourself with the sharpest minds in the trading world. Subscribers to the Tiger's Den are also the first to have their questions answered live on air and can privately chat with our TFNN hosts live during their shows. Interact with other Tigers and Tigresses as they share trading ideas, news analysis, and discuss the market action all trading day. Subscribe to the Tiger's Den risk-free with our 30-day money-back guarantee and become part of the TFNN trading community. TFNN, educating investors. You could be making money off the stock market and if you're already making money off the stock market, you could be making a lot more. Check out TFNN and Tiger TV and get expert investing advice to give you the power to control your financial future. Go to TFNN.com and find the newsletter for you. Whether you're into trading gold, metals, futures, currencies, or options, you'll get advice and analysis to help you seriously get ahead. TFNN also features trading services with a 30-day money-back guarantee for new subscribers as well as TFNN's Tiger Den trading room, trading software, and educational webinars for all trading levels. And make sure you check out Tiger TV for free on TFNN.com or TFNN's YouTube channel for live financial content from 8.30 a.m. to 4.00 p.m. Eastern on market days.  TFNN, educating investors. TFNN is excited about our new software charting program, The Art of Timing the Trade Charts. In collaboration with Tom O'Brien and using his best-selling book, The Art of Timing the Trade, Your Ultimate Trading Mastery System, David White has programmed an outstanding piece of software that will complement any trader's methodology. Using this first-of-its-kind program, The Art of Timing the Trade Charts allows you to scan thousands of stocks for Fibonacci formation setups, including guardleafs, ABCs, butterflies, and much more. The Art of Timing the Trade Charts is designed to help you when scouring the markets for stocks just beginning to form the trading patterns that many investors spend days, weeks, or even months searching to find. And right now, we're offering licenses available at only $79 a month. We are so confident that you're gonna love this new charting software that will even give you a 30-day unconditional money-back guarantee. Don't miss out on this incredible new piece of software. Get your copy of The Art of Timing the Trade Charts today by visiting TFNN.com. This segment is brought to you by Think or Swim. For more information, just click the Think or Swim banner on the front page of TFNN.com. Welcome back, folks. We've got the S&Ps down about 24 points right now. You put this thing on a daily, as I said, from 48.08 down to about a low of 41.30. We'll call it on this chart. We make that level about three times. Late February, early March, and then again on March 15th, quite the acceleration. S&Ps, nine plus percentage points from the low. Qs, 13 plus percentage points from the lows. At some point, it's gonna need a breather, folks. Maybe today's that day, but as Kevin mentioned, man, weakness pre-market. We'll see if it holds throughout the day. We've only been open for less than one minute of trading so far, so far, so far. Let's jump over to Adobe. See how they're training after their earnings. Watch out below, man. 7.3% to the downside. We jump over to the daily. It's been quite a decline for Adobe, man, from 700 right now. You're talking about 431 with that type of an acceleration. Seems like Adobe might be going down to challenge these lows. It had same thing. When you look at where the S&P was, right? From February 24th, we were also down in that area on March 15th. Adobe looks to be coming back to challenge those lows. We put Adobe on the three-year weekly. As you can see again, kind of a critical area. Maybe that's a decent buy, though, man. But if you're buying this thing and it goes through this area, next stop is the COVID highs. Pre-COVID highs, we'll call it of about 385. And we're trading right now at 433 for Adobe shares. Excuse me. All right. Let's jump around to what else we got going on with stocks. We talked about Adobe and yeah, how about the meme stocks? So GameStop was soaring after an SEC filing show that Chairman Ryan Cohn had bought an additional 100,000 shares. So he's got 12% of the company, 11.9%. It's gotta be remarkable being able to control markets, folks. Elon does it. Now you've got Chairman Cohen doing it with the meme stocks, okay? Yesterday, you accelerated from 95 to 123. Overnight, you make it up to 148. You're still up 6%. AMC had a huge run yesterday as well. Overnight, it had that run as well. You're still up 4%. Today, Bed Bath and Beyond with some action yesterday as well. You're basically flat this morning, but you saw the rise up to 25 almost, closes out the day at about 2330. Even the likes of Canopy Growth got an acceleration yesterday and overnight up to 772. We're up 2.4%. Keep your eyes on some of these folks when they start to run. Boy, watch out yesterday was the first time in a while, even overnight. I saw friends outside of the market, people in the den talking about it. Seemed like for the first time in a while, meme stocks back in vogue. And if they are back in vogue, it is not a one day phenomenon, folks. Not sure what's gonna happen, but boy, risk reward wise, last time they ran Canopy, they ran it up to 56.50, which correlated to the same high you had about in the period of 2018, back up there in 2019, runs it up there in the beginning of 2021. We come down, get below, below the COVID lows. Did not think that was possible. COVID lows of nine bucks. Canopy makes it to five and change, I think, 562. The low in Canopy this morning, you're up 3.3% right now on Canopy shares. Watch those meme stocks, folks. The Reddit boys and girls, they're at it again. Interesting to say the least, we'll see where that goes. All right, general mills. They're out with their numbers, strong numbers. They were higher pre-market, better than expected quarterly earnings. They make 84 cents, six cents above estimates, revenue in line with forecast, demand for food at home continues to be elevated. We've been living this life for two years now, folks. There's certain things that we like about it. There's certain things we don't. The things we like about it, we're gonna try and keep working from home, like maybe doing some more cooking. Of course, people are gonna be a little bit more comfortable spending more time at home because maybe they've built out their homes over the last two years, right? Maybe they've spent all that money at Lowe's and Home Depot, which is why you've seen those charts accelerate so much. Maybe they put an extra pool in the back of the house. No, an extra pool. Maybe they put a pool in the back of the house. Maybe they did put an extra pool. Maybe they put an extra jacuzzi back there for the family. Point being, everybody's a little comfortable at home. They spent the last two years hooking up their house, right? Maybe they tapped into a home equity line with a refinance, spent that money on their home, refurbished it, added something in the backyard, put a pool in there. If you could find a pool guy that would actually give you a quote to put a pool in over the last couple of years. And yeah, people more comfortable eating at home. The one thing they're not comfortable with, staying at home and not being able to do anything, which is why things are gonna change. They're gonna be talking about Marriott coming up on fast market. And yeah, some of these stocks, I mean, look at Marriott, right? You're 170 man, you were up to 185, but look at this.  And as I said, went away this past weekend to the JW Marriott in Orlando. Great hotel. If you have a chance to check it out, they have a phenomenal pool. It's got a lazy river on there. They're actually doing some construction work on it, trying to add some slides in there. So with the family, with my dad, my birthday was Sunday, had an absolutely great time. It was the first birthday that I got to like really celebrate with family because in three years, two, well, three birthdays in two years. Cause two years ago, my birthday's March 20th, I think Florida locked it down on like March 16th. I remember coming back and telling my family at the time, even we have a, my fiance is a young daughter who was 13, 14 at the time, probably 13 at two years ago. And she came home on Friday. No, she came home Thursday. And I remember telling her, cause States were shutting down. And I said, there's a high likelihood that over the weekend, Florida's going to shut down. And this was about March 16th and 17th. And so I told her, when you go into school on Friday, if you need anything from your locker, I would get it because you're probably not going back on Monday. And that's exactly what happened. There were already States shutting down left and right. It was kind of foreseeable at that point. The market was already tanking at low is probably at that point. And that's what happened. So my birthday in 2020, I had a good time with my family but couldn't quite have a party. That was the initial, you know, two week lockdown is what we thought. 2021 getting there, but not quite there yet. Not quite the big party, but 2022, man, we went away. We went to a hotel, it was fantastic. Disney, now we have some Disney in my newsletter, Rocket Equities and Options folks. Quite the pullback on Disney shares, man. You pull back to the 618, zooming in on the action of the run from about 79 bucks to 203. You've pulled back to the 618, Disney finding a little bit of a bounce, you're negative with the market today. Now this is spring break week going on right now in Florida. So the kids are out of school right now, at least where I am and in many different areas of Florida. But you can't even get into Disney folks. You need reservations, can't even get in there this week. I think the one park they had open was Epcot, Magic Kingdom, not happening this week. You can't even do it, they won't let you in. Now I imagine spring break, it's a big one, but it's not gonna stop folks. It's not, you know, being in Florida, very fortunate we have the parks and the tourist attractions that are built out that we get to use. Bush Gardens, for instance, I joined Bush Gardens. We got an annual membership now there. Didn't make it to Disney for this trip, but we're probably gonna go back there at some point in the next few weeks, month, hopefully before it gets too hot. It's gonna persist folks in a big way. Disney, I imagine at some point that ship will ride itself, but they're dealing with some issues right now. But man, they're gonna benefit folks when they get the park to business rockin' and when movies are back in vote, which is just about to start I think because we've reached the point. People pretty comfortable. Only people, folks that probably are lookin' at this, that they're not gettin' back to life, and I was in that position, is if you have kids that are waiting to potentially offer them the vaccine before they're exposed, I was in that boat and then our family got exposed to Omicron. And so then, you know, it's tryin' to get the kids vaccinated and make sure that they do well when they were eventually exposed. They got exposed, fortunately they did well anyway, and now we're a little bit more comfortable gettin' back out and many people are in that scenario, folks. Market's pullin' back a bit, but man, it's been a run over the last five or six days. Can't even find it on this weekly chart, right? There's your acceleration last week, folks, quite a bar in a big way. All right, stay pooned, stay tuned. We'll be comin' back to talk to our man, Teddy Kegstad from Forex-Trading-Unlock.com. We'll talk to some Forex, we'll talk to some crude oil. We're right back, folks, stay tuned. Are you in the market for buying or selling real estate in the Bay Area, including the surrounding St. Petersburg, Tampa, and Clearwater markets? Tiger Real Estate LLC is a firm that has extensive experience in the Tampa Bay Area. Whether you're looking to sell your current property for maximum value, or you're in the market for a second home or investment property, Tiger Realty has the experience across all areas of real estate in the Tampa Bay Area to help buyers and sellers make the most informed decisions across all price levels. From the price you should be paying per square foot in certain up and coming areas to the type of cash flow investment properties that are capable of creating, Tiger Real Estate can help you make the best decision when it comes to all areas of the market. Before you make one of the biggest decisions of your financial future, call Tiger Real Estate LLC today at<PHONE_NUMBER>, or email us at tiger at tfnn.com. That's<PHONE_NUMBER>, call us today. The technology around us is changing every day. With so much happening, it can seem impossible to keep up with all the information. David White's investment newsletter, the Technology Insider, is designed to give you all the information you need to understand the technology that shapes today's markets and tomorrow's future. David White has made his living staying on the cutting edge of technology. His weekly newsletter will give you specific recommendations for value tech stocks, as well as entry prices, target prices, and stops to set for each trigger. Dave delivers his weekly newsletters every Friday with updates throughout the week. You can get the Technology Insider at tfnn.com for only $37.50. Sign up for Dave's newsletter, the Technology Insider, and get an inside look at everything the technology sector has to offer. Try it risk-free today with our 30-day money-back guarantee. TFNN, educating investors. Will the S&P 500 continue to climb for bold trades on U.S. large cap stocks in either direction, trade SPXL, SPUU, or SPXS, directions daily, S&P 500, bull and bear, leveraged ETFs, direction leveraged ETFs. An investor should carefully consider a fund's investment objective, risks, charges, and expenses before investing. A fund's prospectus and summary prospectus contain this and other information about direction shares. To obtain a fund's prospectus and summary prospectus call<PHONE_NUMBER> or visit directioninvestments.com. A fund's prospectus and summary prospectus should be read carefully before investing. An investment in the funds is subject to risk, including the possible loss of principal. The funds are designed to be utilized only by sophisticated investors such as traders and active investors. Distributor, foresight fund services, LLC. Don't forget, you can listen to TFNN live on your mobile device 24 hours per day. Go to tfnn.com and hit watch Tiger TV. That's tfnn.com and hit watch Tiger TV. Back folks, we got the markets right now in negative territory. We've got crude oil up another 4.6% we're now above the highs we had yesterday. You got a 114 handle in crude. That's up from 107 early yesterday folks. Quite the acceleration Europe. Five bucks on the session to 4.6% in the positive. Let's jump over to our man, Teddy Cakes at. We talk to Teddy every Wednesday at 40 past the hour. You can reach Teddy every trading day. His website for dash trading dash unlock.com. Teddy Cakes dad, good morning. Good morning, Tommy. So, like we have been, what do you think of the action in crude, man? I'll give you a little, I'm a little surprised myself after waiting to 94 bucks, Teddy, last week, end of last Wednesday. We're up $20 right now, man. The run not continuing. You might not be a surprise. What's your take on this action on crude, man? Well, last week I was saying it was just a corrective profit taking move and we're right back where I thought we would be. We're going to 150 and you know what, odds are we're gonna see, I mentioned already months ago that 150 would be a longer term target and even 200 if the way things are going. So, and now that seems to be a consensus now. And I think that that's very likely to happen. I mean, the surge in so many other commodities and everything else, it's just a domino effect. It's not stopping right now, anytime soon. Especially with the new way the Fed speaking now too, the cost of carryover is gonna explode over the course of the next year.  So I think, yeah, absolutely the oil markets are supported. We're not gonna see any type of reprieve in this whatsoever until, well, you overturn the mandate from January 20th of 2020. So, that's what we need. Now, currency. Quite the run for sure, to 1.14, let's jump to currency. So with all the action going on, of course, quite the move, man, over the last few weeks in yields. Just remarkable, man, 1.7% to 2.4% on the 10 year. What are you looking at for forex markets to start things off today? Well, that coupled with the oil, I mean, remember when we had the Fed announcement last week, we were all looking for the quarter point and we got it. Now, we've talked about this for months before they even started. I said, I'm like, they need to do a half a point at a time. Some people say that's a little overzealous. Now that speech is coming out that they're gonna start doing half points instead of quarter points. I mean, we're looking at, we could see by the end of the year where interest rates will have been up 2%. I mean, that's a big jump considering that they've been very, very slow to act for the past couple of years to begin with. So now this whole thing is driving the trend. So it's supporting the dollar. I mean, between oil and the interest rates, it's really, really helping certain trends. Now, it's definitely weighing on the euro in the Swiss right now because of the Ukrainian conflict and stuff. Now you couple what's going on geopolitically. You also throw in the higher interest rates, and then you also throw in the price of oil. This is making the euro US dollar look like it could be heading towards parity within the next couple of months, for sure. Unless there's some ease and tension between Russia and also the Ukraine, that market's in a bear market. Now we have divergence though. So we're gonna see dollar strength in some currencies and dollar weakness in the others. The Australian dollar, for instance, the New Zealand dollar, those are bulls now. They pretty much at bottom. The only thing that would change that is if, well, either they go back into COVID lockdowns or if they have some kind of major shift in commodity pricing. So we have dollar divergence. I think these trends are now set for the next couple of months if not the next couple of years. We're not looking to get out of this thing anytime soon. We mentioned before about the Ukrainian thing like nothing with Russia ends quickly. So I wouldn't, I would be very surprised if six months from now we're already passed and through this conflict and everything is settled. So I mean, and this is starting to hit other markets too. You gotta realize that as oil continues to go up, I mean, I don't know how it is in Florida, but you can tell the roads here out in Chicago land that during the day, people are, they're making choices now. They're not just willy-nilly going out for coffee and going there and then this and that. Everyone's doing, I'm pretty sure they have a list of things to do and that's what they're doing. And then they're going home, you know? I mean, you can even see it in the restaurants too now on the weekends that it's, the weather's getting better and you're not seeing restaurants overflowing with people now that everything is, everyone can go out. You know, I mean, even in Cook County, you don't need to have a vaccine passport. You don't need to wear a mask, you know? So I mean, it's kind of surprising. You would, everyone wanted to see a different reaction and I think the oil prices is gonna suppress that, but dollar strength is gonna stay. I mean, we have, as long as the Fed is on this track, it would be really hard to see the dollar get really hurt, you know, except for some of your commodity currencies like US dollar, Canada very likely could be a bear over the longer run, you know? Like I said, Aussie and New Zealand, those are setting trends. The US dollar yen, now there's something where, you thought I was happy last week. I mean, look at how it's up another $2 over the past week. You know, so that 122 price target I think is very viable now, we're just floating right below it. And if these trends are really solid and things stay this way over the course of the next six months to the next year, I mean, to see the yen up at 140 would not be out of the realm of possibility. Yeah, just remarkable moves, man. These four X pairings up, as you're talking about the men, you put them on a weekly even, you don't have to, man, because you could put them on a 15 minute, you could put them on an hourly, and this move, like you said, I got the dollar yen up here, man, just staggering, right? From 115 to 121, like you said. But we're at 104 at the beginning of last year. It just almost never stopped, man, the run that it's had, remarkable. And I would agree, geopolitical tensions especially, but it's especially interesting that we're coming into a rate hike environment that isn't going away anytime soon. I was talking to our man, Kevin Hinks, to kick things off. I think we're all aware that the CPI numbers are gonna be a little bonkers, at least for the next couple of months, because gas prices are crazy, energy prices are crazy, food prices are still crazy. Maybe as we get down the road, three, six months down the road, we might be dealing with some comps that'll make it difficult to be dealing with some pretty crazy numbers, but the feds hiking, man. They're hiking this year. The market said it with that 1.7 to 2.4% rise. So that's not going away anytime soon. And I agree, even if we get some kind of deal that I don't expect, they got a handshake deal and everything's over, that's not how it's gonna go, man. There's gonna be tensions. How are they gonna break things up? Is Russia gonna get some of the separatist region, right? How does that play out? There's gonna be tension there, man. And they're probably gonna be dealing with sanctions that's gonna escalate things for the foreseeable future, no matter what, as Russia's a little bit isolated. And that's a scary proposition, no matter how they come out of this. I don't imagine it being rosy, man. The world's just not gonna lift all those sanctions overnight after what's been done. So I agree that that's gonna persist. And it's almost time flies, as we all know, man. I mean, this has been going on for a month. That is crazy when you think about that the war has almost been going on for a month over there. Those poor people, the citizens really, I just can't imagine with young kids in my house, kids, the worst of it all, of course, but pretty, pretty wild stuff. We got about a minute here as we come in, Teddy. What, as we come into, so next week we come into the non-farm payrolls, I believe, on April 1st, which is Friday, and then we get some CPI numbers next week. Do you factor any of that into what you're looking at, or are we just kinda marching on right now because the market's kinda set, regardless of what we get in the next 30 days for data or something like that? Well, definitely the CPI.  They're gonna help accelerate the rise in interest rates. That acceleration and bonds, man, notes, wow. Teddy, we appreciate the conversation as always, man. We'll talk to you next week. Speak. Thank you. Folks, reach Teddy, forex-trading-unlock.com. We'll be right back. Sharpening your skills as an investor is like getting better at playing a musical instrument. You have to practice, sure, but you also need excellent instruction from experts. At TFNN, you'll get advice and guidance from the authority and technical market analysis, and it's not just dry, tedious text either. TFNN airs live financial content streamed live on TFNN.com and TFNN's YouTube channel with Tiger TV, live every market day from 8.30 a.m. to 4.00 p.m. Eastern. For free, each host is an experienced trader and gives their take on the market while taking calls and questions live from around the world. From the moment the market opens until the closing bell sounds, Tiger TV has eight different shows with expert hosts to help you make the right moves with your money. Watch online at TFNN.com or on TFNN's YouTube channel and become the investor you were born to be, TFNN, educating investors. You might think that if you want to be successful at trading in the stock market, you're going to need a crystal ball. After all, it's impossible to predict the future, right? Like any endeavor in life, before you decide it's impossible, get some advice from the experts. You might find that it's not so impossible after all. For daily market overviews that give you direction on the key indices, selective stocks, and commodities, subscribe to the opening call newsletter at TFNN.com. The opening call newsletter is written by Basil Chapman, creator of the trading methodology known as the Chapman Wave. The Chapman Wave up-down sequence gives you an edge in identifying price turns. Finding the peaks and valleys in stock prices.  First-time subscribers also get a 30-day money-back guarantee. If you're not satisfied, let us know and you'll get a full refund within 30 days of signing up. TFNN.com, educating investors.  The Tiger First Mortgage program may be the program for you. The best rate on a five-year CD in the country right now, according to bankrate.com, is paying 1% per year or $1,000 per or $100,000 invested. The Tiger First Mortgage program pays 7% per year, paid monthly, on secured, high-value, billable properties in St. Petersburg, Florida. The investment is for four years, paying 7% per year or $7,000 per or $100,000 invested. Your investment is secured by high-value real estate in St. Petersburg, Florida. Your investment can be anywhere from 100,000 to 500,000. You wanna make 1,000 per year on $100,000 invested or 7,000 per year on a secured Tiger First Mortgage. The Tiger First Mortgage program may be just the program for you. The Tiger First Mortgage program pays 7% per year, paid monthly. For more information, you can call<PHONE_NUMBER>. That's<PHONE_NUMBER>. This segment is brought to you by Think or Swim. For more information, just click the Think or Swim banner on the front page of dfnn.com. Welcome back, folks. We're at the market. Excuse me, market's tallying off a bit. We got the S&Ps right now, down about 8.10%. It's been sell off territory since about 2 a.m. this morning. Lots of red bars there. We sell off a little bit on the open with down 8.10, so you get the NASDAQ 100 down 1.1% right now, 14,490 Dow off about 8.10%. Checking in with some of the meme stocks. GameStop up another 12% right now. AMC up 7.6% right now. Bed Bath and Beyond down 4% right now. You got winners and losers over there. Talked about Canopy. Canopy up 3.8%, little bit of volatility in there as well. Some of the short percentages, folks, of these stocks, who is shorting a stock like Canopy that is at $6 to $7, folks? You know who is? 19% of the float in Canopy is short. Now, because Canopy has some issues with warrants, they got a lot of insiders controlling the shares. The float and the amount of shares differ greatly, so the percentage of the shares outstanding, only about 12%, but that's not as important as the short percentage per the float. Canopy growth about 19% AMC, about 19% folks, Canopy the same percentage as AMC. Now, we have a trade in Canopy going on this morning. As I talk about it for disclosure, talking about it, you should know that we do have a trade on it, but it's important to understand those short percentages. Now, GameStop, the original meme stock of them all, 25% short percentage, all right? God bless those people, man. We'll see how that plays out. Pretty remarkable what's going on over there. All right, a couple more headlines as we wrap up the program here. This one's interesting on a geopolitical spectrum. Perspective, I should say. You got a Putin advisor quitting over the Ukraine war and leaving Russia. Obviously, he's high enough in the ranks to be able to get out of the country. How'd he get out of there? Long-time reformer had been the Kremlin's climate envoy. Few senior insiders have gone public opposing the invasion. I'm not familiar with this man. Maybe many are, but nonetheless, he opposes it. He's left Russia. It'd be interesting to see if more of that comes to fruition, especially some of those oligarchs, if they really start speaking out there as well. How about global bone losses? $2.6 trillion we're at, folks. That is the number. A drop in the index of a value of about 2.6 trillion. Be careful in those fixed-income markets, folks. Lower prices coming at you. And then another one, day traders, taking money out of the market and selling. Last week, interesting stocks. See you soon, folks. We got Basel Show next, live programming after that all day. Have a great Wednesday, everybody. Building wealth trading in the stock market seems impossible to most people. They think it's too volatile and risky. Most people aren't going to take the time to educate themselves on how to do it right. But you're not most people, are you?  All TFNN subscriptions, books, software, and courses are available at tfnn.com. And I'm even going to tell you how to get them for less. Use TFNN's tiger dollars, and you'll get up to a 20% bonus on your purchase. And once you apply them to your account, tiger dollars are automatically used for all future or recurring charges. Tiger dollars also never expire, are fully transferable, and are a great way to add savings to your newsletters or services. Become the investor you were born to be at tfnn.com. TFNN, educating investors.


You know, we will be talking, in this particular session, we'll be talking a little bit about both Linux and Android. We'll talk about a couple of places where Android is missing some very key support for multicore, which is an interesting problem, given that there are so many tablets these days that are all switching to multicore tablets for phones and tablets running Android. And when you get into the actual Android framework, you realize that the Android framework really doesn't support multicore very well. So the underlying mechanisms inside of Android, the native development kit, and the actual libraries, the bionic libraries themselves, do support multicore. But unfortunately, they haven't moved that support into Android itself. So from an Android perspective, if you go to create a thread, you have no control over where it runs. It just runs wherever it happens to run. And that's not, as you'll see in this session, that's not what you want. You really want to be able to reach out and control a lot of these things, especially if you're trying to move legacy code. So let's go ahead and get started here. My name's Mike Anderson. I'm Chief Scientist for the PTR Group. I've been in the embedded systems business now. Got my first job writing code on an 8080 back in 1977. So I've been in the business for a while, working with embedded Linux since about 2000, and then Android since about 2007 or so. So 2008, actually about 2008 is when I started with Android. So I've had an opportunity to see a lot of equipment, see a lot of components, see things that work, see things that don't work. And of course, one of the key problems that we're running into now is today it's very difficult to actually buy single core processors. Most of the manufacturers realize that if they want to move up in the value chain, if they want to sell more product, the way they do that is they sell you on the concept of multi-core. So we'll talk a little bit about the motivations for multi-core migration. And we'll compare the Linux and Android threading models to other threading models and other operating systems. This is really where we start to see the key differences between the way Linux works and the way operating systems like VX works or Windows or one of those operating systems behaves. And it's all about how the scheduler schedules threads onto CPUs, onto cores. We'll talk a little bit about logical versus temporal correctness and then how we have to go about rethinking our architecture in order to be able to address the issues associated with migrating to a multi-core platform. So there are a lot of things that we could talk about. Unfortunately, we only have 50 minutes. So we're not going to be talking about instruction level parallelism. We're not going to be doing anything about SSE, SSE4, Neon, any of those really cool things. We're not going to talk about OpenMP or Super Scaler out of order execution. We won't talk about SMT, simultaneous multi-threading, the hyper-threaded codes. And we're not going to be getting into a lot of detail on any of the SIMD instruction sets. Each of those topics is a very worthy topic and could easily take an hour by itself. So unfortunately, we just don't have enough time to address those. We're going to focus on one thing primarily, and that is what happens to your code when you allow threads to start migrating around on the CPU cores. So we're pretty much all aware at this point what the motivations are for multi-core. Lower thermal envelope. I mean, that's a significant one. If we can cut the current, the power back to the CPU, if we go from 1.5 volts down to 1 volt, then we can significantly change the power consumption of the platform. That also changes the thermal envelope of the platform. So we have lower thermal envelopes, lower power consumptions, and in theory, the ability to scale our code across multiple execution units. However, there are several gotchas in all of that. One is that each core is now clocked slower. Typically, if we had, for instance, in the first Intel platforms that came out, they had a 2.6 gigahertz Pentium. But the Pentium D, which was the dual core version, dropped that back to 1.8 gigahertz. And the reason was because now you have basically twice the number of transistors in the same physical footprint. And you just can't run them at the same speed. Otherwise, you generate way too much heat, and the silicon becomes a molten slag pile. And that's not what you want. So they would typically clock the core slower. Now, we'll also see a problem with cache misses and process migration. And that's going to be the primary focus of what we're going to be talking about here. And I have a couple of demonstrations that I'll show you that actually show the impact of these concepts. What happens when you allow things to migrate around? What happens when you allow cache misses to occur? So a lot of today's code that's coming especially from the world of real-time operating systems is all single-threaded. Or if it is running on a multiprocessor and has multiple threads, you're really using the idea of having those multiple threads with different priorities to ensure that one thread executes to completion before another thread gets a chance to run. So when we talk about a single-threaded application, one that there is only one main thread in there, then that really can't take advantage of additional cores. As a matter of fact, we saw this in the Windows world when they first introduced the dual-core Pentiums. People were running games. And they go, oh, cool, I'll buy this dual-core laptop. And my games will be twice as fast. And they really found out that their games ran a lot slower on a dual-core because of the different clock rate. So there was a lot of disappointment. And Intel had a significant problem on their hands because they couldn't convince people that buying multi-core processors really bought them anything. It was a slower application. That was because most of those applications were single-threaded. Now, Intel did one thing to try and combat that. They added this feature called Turbo Boost. And what Turbo Boost does is it looks at the thermal envelope of the part and says, if I've got four cores and I've got a good thermal envelope, then what I'm going to do is I'm going to idle a couple of the cores. I'm going to boost the CPU, the clock speed, of the other two cores. So when we go to Turbo Boost, we see them now marketing. Well, it's really a 2 gigahertz processor. But it could be as much as a 3.6 gigahertz processor. Well, that's only if it's able to idle the other cores. Otherwise, the thermal envelope is such that you can't do that. And not all operating systems support that. So it really is kind of a question as to whether or not you're going to get better performance on a multi-core or not. Now, if we talk about multi-threaded code, it's got multiple simultaneous execution paths. Now, what this means is that if we were in an operating system like VxWorks, for instance, we would typically have multiple tasks. Each one of those tasks would have their own unique priority assigned to it. And the way the scheduler works in VxWorks, it is highest priority always wins. So the highest priority thread would run to completion before the next priority thread would get a chance to execute. You can do a lot to protect global variables that way. Because there's no contention if the one that has access to the global variable has the highest priority. Unfortunately, that doesn't work in a multi-core system. Now, when we talk about algorithms, we talk about how we write code, we have to think in terms of the scalability of the code.  Basically, this is Amdahl's law. This says that the actual scalability of the algorithm is a ratio between how long it takes to run on a single processor versus how long it takes to run on a multi-processor. In the perfect world, you have 100% scalability, which means if I go from one processor to two processors, it's twice as fast. If I go to four processors, it's four times as fast. Unfortunately, that doesn't work. And the reason it doesn't work is because of bus contention, because of resource contention around semaphores and several other synchronization primitives that always get in the way. The bus contention one is a tough one. You really can't do much about that. Certainly the synchronization primitives, those things you can tweak. And we'll talk about how you do that here in this particular session. So if we take a look at the threading model that's used by Linux and Android, there is, of course, the one Linux kernel. And the one Linux kernel with 2623 switched to a new scheduler. Prior to 2623, they had what they called the 01 scheduler, which was guaranteed a constant time dispatch, regardless of the number of threads you had.  And that was it was based on how much CPU time you had used and whether you had exhausted your entire time slice. And things that had exhausted their entire time slice were marked as CPU hogs and things that gave up the time slice before the time slice expired were marked as IO bound. So CPU bound got smaller and smaller time slots, time quantums, and IO bound jobs got bigger and bigger time quantums, up to the point where you could actually get about 800 milliseconds allocated to your thread as long as you always gave up the CPU before your time slice expired. Well, 800 milliseconds, that's a long time. So they found that, hey, this really wasn't all that fair. So they replaced it in 2623 with a completely fair scheduler. Now, the completely fair scheduler uses a red-black tree to do its scheduling. And the red-black tree has a characteristic that it's a self-balancing B tree so that the depth of the tree never gets anything beyond N log N number of elements inside the tree. So that's a good thing. It gives us constant removal time. That is, constant dispatch time. We always know exactly which thread's going to get the CPU next because it's always the leftmost node of the red-black tree. But it's N log N to insert things into the tree. And so insertion takes a lot longer than removal does. Fortunately, we're removing things from the tree a lot more often than we are inserting them into the tree. So it kind of balances out. Now, that's four things that are executing at priority zero. What happens when you execute at priorities above priority zero? Well, first of all, only root can get to those priorities. That's sked-fifo and sked-round-robin, sked-other or sked-normal of stuff that runs at priority zero. And what runs at priority zero? Well, everything. Compilers, editors, everything runs at priority zero. Anything that you then purposefully scheduled at a priority above priority zero, you had to be root in order to do that. And you had to change the scheduling policy when you created the thread. So what happens in Linux and in Android, as it turns out, the scheduler is a one-to-one scheduler. So there are a couple of different models that we can see in scheduling and thread scheduling. One of them is the M to N model, which says, when I schedule, I schedule processes instead of threads. So that's the model that was used by Windows XP. We would schedule a process like Microsoft Word. And then once you were in the process, the threads would duke it out amongst themselves to figure out who got the CPU time slice. That's not the way Linux does it. Linux uses a one-to-one scheduling model where each thread is independently schedulable. And what is a process? A process is a thread called main. So as far as the scheduler is concerned, every process is just another task struct. And if that process happens to have multiple threads inside of it, then we have multiple task structs that are all considered equally when the scheduler runs. So what's going to happen with the scheduler is every time the scheduler runs on a CPU core, it's going to pick the highest priority thread ready to run at that time on that CPU core, and that thread wins. So like the RTOSes, Linux really uses a highest priority always wins model. Now, whether that's highest priority off of the red black tree, which happens to be the left most node, or highest priority in the static priorities from zero to 99, whichever one is the highest wins on all cores. There is only one scheduler. It runs on all the cores simultaneously. When does the scheduler run? After every interrupt service routine, every interrupt service routine, keyboard, mouse, ethernet, whatever. And after a lot of functions in user space, and several things that happen in kernel space, mutex operators, reader writer locks, spin locks, all these things can cause rescheduling to happen. So when we talk about this one-to-one threading model, we have to realize that each one of the threads inside of a process shares the same MM struct pointer, and therefore shares the same address space. So as far as the threads are concerned, sibling threads in the same process see the same memory. And therein lies the problem, because now we have a situation where each one of these threads sees the exact same data structures at the exact same time from separate CPU cores, potentially. And that's where we get into this concept of a race condition. So the scheduler on a unit processor would say, hey, priority 50 thread outweighs a priority zero thread, priority 50 wins, runs to completion, gives up the CPU, priority zero gets a chance to run. Maybe, if priority 50 didn't reschedule itself. On a multi-core, however, it is the highest priority thread ready to run at the time the scheduler executes. So we could have a priority 50 thread running on CPU core zero, and a priority zero thread running on CPU core one simultaneously. There's where our problem starts to happen when we're trying to move legacy code that was dependent on priority execution over to a multi-core system. Because now priority execution, yeah, it still sort of works on one CPU, but now we've got multiple CPUs and the priorities get mixed up because it's the highest priority that's ready to run at the time the scheduler executes. So because these things can now run simultaneously on multiple cores, we have race conditions. So what exactly is a race condition? Well, a race condition is a little difficult to understand in some cases. What we have here is programmatically correct code. It does the right thing. It just doesn't do it at the right time. So we have something that is logically correct, but not temporarily correct, which means that when we start moving to multi-core, we have to think in a different dimension. It's no longer, does it do the right thing? It's, does it do the right thing at the right time with the right data? So it adds an interesting complication. So race conditions are technically a violation of temporal correctness, often referred to as live lock. Now it's not a deadlock. The threads keep running. That's the problem. If it was a deadlock, you'd know it. Unfortunately with a live lock, they keep running generating incorrect answers, but you don't know it until the robot spins around and spot welds somebody behind it, something weird like that. All right, so where's the contention? What's the problem? What are we trying to solve here? Well, in most cases, race conditions come about because of contention over shared data structures. And this is particularly troublesome inside of a process because all the sibling threads share the same address space inside of the process. So they can pass data back and forth between the siblings by simply passing them by address. Pass me a pointer, I've got it. Hey, I can access this data. Now that's not the case between processes. Between processes, the MMU sets up a memory barrier, basically, that keeps, because of these local address spaces, keeps applications from pointing into another process's address space and mucking around with their data. It's not that it isn't possible to do that because you can, in fact, punch holes between the address spaces, but you have to go out of your way to punch holes between the address spaces. It's not something that happens automatically. And so what happens is this contention over resources doesn't happen on a uniprocessor because we usually have a piece of code that's running and it will run to completion before a second piece of code gets to run. And therefore, there's no contention. It only has contention if two pieces of code try to access the same thing at the same time. So what this implies is that there's a critical region of code, some sequence of events that has to be mutually excluded from other pieces of code at the same time. Now this also means that we're going to have some serialization around certain places in memory. And these memory places are referred to as memory hotspots. The more threads we have, trying to touch the same locations in memory, the more likely we are to have cash contention and CPU contention and therefore end up with a race condition around this shared global piece of data. So how do we go about detecting a race condition? Well, you could try to do static detection. And there certainly are some applications out there, clockworks, insight, covariate, prevent. There are some commercial products out there that try to detect race conditions statically by looking at your code. The problem is that static detection of a race condition is actually an NP hard problem. And for those of you who are math challenged, NP hard is the same types of problems they use for encryption algorithms. They're not made to be broken within oh, three or 400 years. So if you have yourself an NP hard problem, you basically have something that can't be solved easily. And that's really what we have if we try to do static detection of a race condition. Because a race condition is all about time. If without the time domain, we can't adequately represent the problem. So there are some heuristic detection techniques. And these are ones that kinda look at the code and they go, you know, there could be a problem here. I'll go ahead and flag it. And that's really what most of these tools, these commercial tools do. They have kinda rules of thumb and they say, if I have two threads that are accessing the same data at the same time, that could be a race condition, I'll flag it. Now, is it a race condition? Well, we only know that it's a race condition at runtime. So the problem with race conditions is we can technically only detect them after they've occurred. And unfortunately, most of our systems don't have the ability to run backwards in time to undo the race condition. Although there are some that I've seen that can do that, which is really kinda cool. But neither here nor there for a Linux perspective at this point. So dynamic detection is really the only way we can detect that our race condition has occurred. But unfortunately that means the problem has already occurred and you can't fix it. So one of the key things about race conditions is understanding what causes them and avoid them in the first place. When people ask me, how do you do debugging? Well, the answer is really simple. Don't put the bugs in in the first place and you don't have to get them out later. So that's the situation that we have with race conditions. If you understand the things that cause race conditions, then you can take steps to avoid the race condition ever happening in the first place. And the first thing that you do there is you look for the use of global data. Is there data or a data structure that's being shared between multiple threads at the same time? If there is, then that's one of the things we wanna avoid. So how do you do that? Well, one thing is to simply say, eliminate all global data. That's easier said than done. We could use the stack. The stacks are all unique on a per thread basis in Linux. Therefore, if we pass things on the stack, we can have reasonable assurance that we're not going to run into any contention over the stacks. That's probably a good thing. Or we could use thread local storage. Thread local storage in Linux, we can actually allocate thread local storage and then manipulate the individual variables in a thread specific way. Unfortunately, all of these approaches require you to rewrite your algorithms in some way. To rethink significantly the way your code operates. And when you're trying to move a million lines of legacy code from a unit processor to a multiprocessor, that's not what you wanna have to tell your management. Oh, we need to completely redesign for multicore. They don't wanna hear that. So what can we do in order to get past those problems with a minimum amount of headaches? So really contention arises from threads on separate cores. If all the threads are locked to a single core, then we've effectively reduced it to the unit processor problem. And by reducing it to the unit processor problem, then priority preemption works and we've eliminated the problem. Unfortunately, now this is referred to as containment, unfortunately when you do containment, it means that we've just taken the reason that we bought multiple cores to run multiple threads at the same time and we've eliminated the ability to execute on those multiple cores. So we've just killed the reason why we bought multicore in the first place. So this is a significant problem. And as this notes here, whereas Linux has support for thread affinity and the ability to control assignments of threads and things of that sort, that does exist in Android. The scheduler certainly supports it. Bionic libc as of ICS supports it. The NDK as of ICS supports it. But the Java framework, even as of Jellybean, still does not support the ability to assign threads to particular cores, which is referred to as setting the threads affinity. So this, in order for containment to work, we really have to take advantage of priorities. But these are the problems with containment. You have the issue of you've just reduced the problem back to a uniprocessor. And since multicore processors tend to run at lower clock speeds than uniprocessors do, you've slowed the application down by moving it to a multicore system. And that's, again, not what you wanna tell management. You just spent all this money for me to buy this fancy new hardware and gee whiz, the application runs slower on the new hardware than it did before. And the requirements here can be kind of subtle because even though I might have a slightly higher elevation in the way the Linux scheduler works, at priority zero, we can have up to 20 different, 20, 40, 40 different sub-priorities of priority zero. These are called the nice levels.  So there is a very subtle window here where I could have one thread executing at priority zero and its time slice expires. While it was accessing the data structure. And another thread comes in right behind it and then accesses the same data structure. Well, this isn't going to happen very often, but that's the really subtle problem of race conditions. They don't happen very often, but they only have to happen once for the plane to fall out of the sky. So we have to be aware of this potential for the scheduler to do exactly what it's supposed to do, switch a thread out because its context, its time slices expired, switch another thread in that happens to access the same data structures. Again, it might take, I mean, on a fast machine, it might take years before this problem happens. And you may be then off to another job and it's somebody else's problem to try and figure out that there was really a problem which may not be necessarily a bad thing. It depends on how you look at it because you could always then be called back as a consultant and make big bucks. All right, so the concept of encapsulation, we could create a thread, I mean a class that encapsulates access to the data structure, but unless for some reason the operating system automatically includes some sort of synchronization primitive in the existence and the execution of classes, we still basically are in the same boat. It doesn't matter, I mean, I've seen a lot of folks where they think, well, okay, if accessing this data structure is a problem, I'll put it in a class and I'll make a method and the method will then access the data structure. Well, unless the method actually does mutual exclusion, you haven't changed the problem. It's the same problem. You just simply put it inside of a class wrapper and it hasn't solved anything, but it certainly is much more object-oriented in the way that it fails. All right, so what's the easy way to solve this problem? Well, the most common technique is to use mutual exclusion semaphores. And mutual exclusion semaphores have the advantage that in the way Linux executes them, they execute as few texas or fast user space mutexes. And a few texas adaptive in nature. One of the cool things about the few tex is it doesn't try to take the mutex and then immediately give up if it's not available. What it does is it actually spins for a few cycles to see whether the mutex becomes available soon. The idea for all these cases where we're talking about dealing with the critical region of code is we keep the critical region short. You lock, access, unlock as quickly as you can. Same thing, Stephen Rosdett was talking earlier about spin locks, same thing. Go in, lock it, access it, unlock it as quickly as you can. So with mutual exclusion semaphores, we have basically, because they don't immediately sleep, it means that if I have a thread that's just getting ready to give up the semaphore when another thread is trying to take it, then the other thread doesn't go to sleep. That's a good thing. And it does have priority inversion support. It also has the concept of ownership. So these kinds of semaphores, there are two basic types of semaphores that we run into in user space. One is a binary semaphore, which is used for synchronization. And the other is a mutual exclusion semaphore which is used for mutual exclusion, go figure. So with this concept of ownership, that's a really important thing. And we'll come back to that in just a minute. So for those of you who may not necessarily be familiar with the priority inversion problem, we have three threads here, low, medium and high. Low priority thread takes the mutex and continues execution. It then gets preempted by a medium priority thread. Well, that's exactly what it's supposed to do. So everything's operationally exactly the way it should be. We then get the medium priority thread preempted by a high priority thread. That high priority thread does exactly what it's supposed to do, but it runs out here and it tries to take the exact same semaphore that this one already owns. So the semaphore is unavailable, which causes the high priority thread to block. But now, because this medium priority thread is sitting out there, with priority inversion, the medium priority thread gets the CPU back and continues execution. If we don't know how long that's going to run, this is called unbounded priority inversion. And this is a significant problem. It is not a bug in the operating system. It is an error in your understanding of how things interleave in time. Unfortunately, it happens so often that they've come up with a way to fix the problem in the operating system. And that's called the priority inheritance semaphore. So with the priority inheritance semaphore, which is what the few-text is, the fast user space mutex, they have the same sequence of events. We take the semaphore here, we get preempted. This is all finding good. We run the high priority thread, it tries to take the semaphore. But as soon as it realizes the semaphore is taken, the kernel looks to see who owns it and says, oh, wait a minute, I've got a priority inversion problem here. So I will raise the low priority thread up to the priority of the highest priority thread waiting for the semaphore. It will execute it that priority until it gives the semaphore back, in which case it goes back to its original priority. The high priority thread then runs to completion, gives its CPU, I mean, its semaphore back, and then the medium priority thread gets a chance to run. And this is a great solution. It actually solves a lot of problems. And it's relatively new in Linux. It's only been around for a few years. It was certainly one of the major reasons why a lot of embedded systems people refused to use Linux, because it did not have this support for a long, long time. Now that it's got this support, it solves a lot of problems. By the way, one of the most known errors of this happening was on Mars. It turned out that there was a problem contending over some flash memory space on one of the rovers, and it was causing the rover to go offline for a long period of time. So they fixed it by uploading, it wasn't Linux by the way, this was VxWorks. They fixed it by doing an interplanetary FTP upload of a patch. And then they found the highest appointed NASA official at JPL to push the reset button. Because they figured if he was appointed, they wouldn't fire him, because the president had appointed him. And unfortunately, the real big problem is the round trip time to Mars and back is like 20 minutes.  Or is the thing gonna come back? And it actually didn't come back after 20 minutes. There was a, they had neglected to take into account some other initialization time. Well, in any case, it did work though. So, but what are the characteristics of mutexes? The problems with mutexes are that on the plus side, when you try to take a mutex and it's not available, it caused you to block, which causes you to give up the CPU and give somebody else a chance to run. Giving somebody else a chance to run is a good thing. It means that we're actually doing the time sharing that we're supposed to be doing and keeping the CPUs busy. Unfortunately, giving somebody else a chance to run means a context switch. And that context switch, if we happen to be running low on translation look-aside buffers, which we almost always are, it means we're gonna have to flush the caches. And when we flush the caches, we're gonna take a huge performance hit on the cache flush. Realize that a cache miss in an L2 cache on a typical processor going from L2 cache to physical RAM is gonna cost you about 200 clock cycles. And that's 200 clock cycles you will never get back. So every time you have one of those cache misses, you're going to take a significant hit. Now, therein lies an interesting problem for multicore called fault sharing, which we'll talk about a little bit later. So when we have the Threads API, it turns out the P-Threads API not only supports mutex semaphores, it also supports this thing called a spin lock. And you don't see spin locks used very often in user space, thank goodness, because what they do is they burn CPU cycles like crazy, but they do exist and you could use them if you knew, if you had a priori knowledge that the resource that you were contending over was going to be available soon. How soon is soon depends. So it might produce better performance if you use spin locks, but it might not. Because remember you're burning CPU cycles and those CPU cycles could just as easily be used some place else. So the overall amount of work that gets done when you're using these spin locks could be significantly less than if you use mutual exclusion semaphores. Another technique, of course, is to use message queues. In the message queue, we basically decouple the source and the sync of the data. So the source writes into the message queue, the message queue has in number depth. The sync has a chance to run at his rate. So what message queues do is they introduce a synchronicity into the system. So I can produce data at one rate and consume data at a different rate and we rely on the message queue to keep the buffers straight and make sure that everything is delivered in a first in, first out order. Unfortunately, message queues require two copies. One into the queue, one out of the queue. We can mitigate this if we use a shared memory segment and we write into the message queue the address of the message that we're trying to send and its size. If we do that, if we have variable link sizes for whatever reason, then we can use message queues and we can decouple the source and syncs. So we can actually get quite a bit of execution performance out of it by simply decoupling and making things more asynchronous. The thing that I mentioned a little bit earlier and the one thing that you have to be careful of is the use of binary semaphores. Binary semaphores look an awful lot like mutual exclusion semaphores. However, binary semaphores do not have a concept of ownership and because they don't have a concept of ownership, if I do recursive calls to a binary semaphore, I'll get a deadlock. So if I'm in a function A and I take the semaphore and then I call the library B, which also tries to take the semaphore, that'll cause a deadlock with a binary semaphore. Does not cause a deadlock in a mutual exclusion semaphore. So you have to know exactly which semaphore you're using and why you're using it. If you're trying to keep contention away, mutual exclusion, use a mutex semaphore. If you're trying to say wait here until this event happens, that's synchronization. That's where binary semaphores are used. Different programming patterns for different types of semaphores. So what are our guidelines here? When developing an application, first thing you wanna try and do is identify all those activities that can run in parallel. Things that don't depend on each other and identify the data flow through the application. I have a piece of data, starts in this interrupt server routine, moves to this device driver, comes into my application. My application has a processing pipeline. This thing has to touch it, then this thing has to touch it, then this thing has to touch it, then I light an LED. Whatever that processing flow may be. Identify the flow and identify what activities have to share the same data. Once you know that, and this is a concept known as data flow programming, where we look at the data flows and we try to understand what the transformations of the data are and how they're related to each other in time. We identify the correct sequencing of activities. I have to do A, then B, then C. I can't change the order or I introduce a potential race condition. I then also have to identify the relative importance of these various tasks and assign priorities associated with those. So we might have to go in and make adjustments to the priorities based on what we're seeing in execution time. But don't assume that priorities will preclude race conditions because they won't. Remember, because of the way the scheduler works, I could have priority zero running at the exact same time that priority 50 is running on a different core. So priorities do not guarantee that I'm going to run to completion. When you're designing your thread, basic rule, keep them as separate as possible. Don't share data unless you absolutely have to and then only share data in a very regulated way so that you know exactly what the interaction is. Also, try to keep data used by threads on separate cache lines. Now, this is a really subtle problem because if I happen to have an array X sub zero and X sub one, X sub zero is being accessed by core zero. X sub one is being accessed by core one. If those two variables happen to fall on the same cache line, then every access from either CPU, even though they don't overlap, force cache flushes and cause an impact called fault sharing. And fault sharing is a really subtle problem. Basically what happens, it causes some ping ponging effects between the processor caches and can cost you as much as 600, 700% in terms of performance impact just because you chose poorly in the allocation of your data. So the effective use of multi-core processors does require some thought on your part. You can't just simply take a piece of code that's been running fine in a unit processor, drop it on a multi-core processor and expect it to be faster. In fact, it's almost guaranteed that it won't be. And the chances are very high that if you then add multiple threads to take advantage of the multiple cores, if you don't pay attention to what you're doing, you will introduce a race condition. We can fix this using mutual exclusion semaphores and we can address processor affinity in order to optimize the code. So let me show you a couple of examples here. Oops, that's the wrong one. There we go. All right, so first of all, I have a piece of code here called mutex. And what this code does is it has two threads, a looper thread and a conflict thread. And what these threads do is the conflict thread tries to access a, oh, sorry, it's down here a little bit further, tries to access a location in memory. Actually, it looks at two locations, value one and value two. So the main thread simply increments value one and then increments value two. The conflict thread here says, hey, if these two things are not equal to each other, then I have a problem. And at this point in time, they must be equal to each other. They may not necessarily be equal to each other in any other point in time. But as long as they're equal to each other right now, we're good. So what does the other piece of code look like? Very simple. Value one equals counter, value two equals counter, counter plus plus. Now, when we're trying to figure out what the critical region of code is here, what things do we need to protect? Do we need to worry about the counter's increment here? Knowing what we know about the conflict thread, do we even care about counter? No. The only thing we're interested in is value one and value two. So what we're saying here is the only way this code would fail is if somehow I managed to preempt the code right between these two assignments. Now, on the x86, this is about six assembly language instructions. What are the odds that you would be able to preempt precisely between six assembly language instructions? I don't know. Maybe not very good. But maybe, maybe it's a lot more than we think. Every single one of those messages is an error. Now, the thing is, hey, these values aren't the same. The thing is, look what happens. Let me just control C this. Look at what happens. I can go for 500,000 iterations and the problem doesn't happen. If I'm testing in my lab, well gosh, I could run a five or six test and it would never happen. It only happens if I happen to get the preemption just right at the right time. Yeah. Oh, no, no, no, no. Doesn't matter. It does not matter because it's only at the time of the equals, if value one equals value two, that's the only time it matters. So, except the printf here, we may in fact see, in this case, multiple differences. It can absolutely confuse, absolutely. And so one of the things that we can do with this is I have this piece of code and it does all kinds of cool things. We can enable containment and run. And here I've got both the looper thread and the conflict thread locked towards zero. And this appears to work. Problem is, there's still a subtle problem here and that is if the conflict, I'm assuming the looper thread happens to expire its CPU time slice exactly in those six instructions and the second one comes in before those six instructions had a chance to finish, we still have a race condition. This doesn't look like it has a problem, but in fact it still does. Ah, there we go, we got one. All right, now with this particular, this is a quad core with dual hyper thread. So we can actually run, in some cases, that was really fortunate. I've seen this run for hours before one of those things happened. So that was really cool that it happened so quickly. Now, on the other hand, we could say, well let's do priorities and see if we can solve the problem by using sked-fifo priorities. No, sorry, just simply setting the priorities doesn't solve the problem. Containment doesn't solve the problem. What if we set affinities and lock them to different CPU cores? Ah, no, sorry, still doesn't solve the problem. So the only way we can solve that problem in this particular piece of code is to turn on semaphores. Once we turn on semaphores, then the problem never happens and it basically just runs happily. And in this particular case, we're not locking the cores, we're not locking the applications, the threads to any particular processor cores, we're allowing them to migrate around. So what's happening if you look at my CPU meter, we see the CPU meter here, oh, I just happened to position it over something that was bright, didn't I? Here, let's switch. Yeah, that's it, it's not gonna do that. It's hard to see it. But the applications are migrating around, there they were on that core, now they just popped over to core one, they were down here on core six, they're moving around all the time. So that's something that we see that's kind of endemic to this kind of problem. Now, I'm just run out of time here, but let me show you one other thing just for those of you who are curious. I will show you what happens when you have fault sharing across caches. So we're gonna run a program here and what this program does is it has two threads that are accessing different locations in memory over the same cache lines, off of different cores. So, excuse me, how did I get them on the same cache line? Oh, that is the key question now, isn't it? And if you send me an email, I'll be happy to send you the code, you see how it's done. So we're starting here with two accesses, this one happens to be zero and one, there's one and two, and you see the elapsed time is about 12 seconds. So these are two separate threads running on the same core, accessing the same cache, and we're seeing that it's taking about 12 seconds to run through several hundred thousand iterations. Now, this thing goes up and it goes up to, I don't know, 1,024, something like that, but as soon as it skips through all of this and it actually gets to running on multiple cores, we then see the effect of the cache lines because running on multiple cores instead of taking 12 seconds, takes six seconds until we cross the cache line boundary. And because we cross the cache line boundary, it means that now one core is executing on one cache line and the other is executing on a completely separate cache line and suddenly you see a 600% improvement in performance because we cross that cache line boundary. So I realized that it's, well, we still have a few minutes here. This one's almost finished with the same core. As soon as it drops to multiple cores then the time gets cut in half. I do happen to be running a conservative power governor right now. So I think it's running at about 1,200 megahertz on this processor. But as soon as it crosses this next boundary here with 1,024, then we jump to multicore. And as soon as we're on multicore, you'll see a significant difference in the performance, time being what it is. But any, while we're waiting for this to happen, any questions? Anybody still awake? Am I still awake? Oh yes, I'm still awake. Ah, here we go. We go to multiple cores now. First one, come on. Okay, so this one is slower. But that's because we haven't yet, we're now ping-ponging back and forth between the caches. So as soon as we get to the cache line size, then you'll suddenly see a huge difference. And the cache line size on this particular processor happens to be 64 byte cache lines. Now, how would you know that? Well, you know that if you go into slash proc slash CPU info, and in the CPU info they report to you what the cache line size is. At least on most processors it does. Otherwise, you have to, shudder, read the data sheets for the processor to figure out what the cache line size is. Now, like I say, as soon as this crosses the 64 boundary, you'll see it change. So can I answer any questions for anybody? I was all crystal clear. Everybody got that. I'm glad. Yes? No way, no, sorry, no, of course. It's all open source. And just send me an email, mic at the PTR group. Of course, these charts will be posted. They should already be posted. If they're not, then they will be posted shortly. My email's in the charts. I'll be happy to send you a copy of both the mutex code and, of course, the magic make file that makes it and this false sharing code. Oh, here we go. So here we see it dropped just simply because now this piece of data is on one cache line. This piece of data is on a different cache line. And depending on what you're doing because I'm running some other code here, it's not as big a jump as I would have hoped, but still it's six seconds instead of 14 seconds. That's fairly significant. And it's just a question of understanding how the data has to be aligned, which may mean that you have to be wasteful in memory in user space in order to guarantee that the data structures are aligned on different cache lines. And by being a little bit wasteful on the data line, on the cache line alignment, you get big performance increases from multicore. So that's all I have. If there's no more questions, I appreciate your time. Thank you very much.