title: Quest for Camelot

text: "Quest for Camelot" was released on VHS and DVD by Warner Home Video in the United States and Canada on October 13, 1998. The VHS edition includes a teaser trailer for Warner Bros. and Morgan Creek Productions' "The King and I" (1999) and the Tom and Jerry cartoon, "The Two Mouseketeers", while the DVD included several making-of documentaries with interviews of the filmmakers and cast and a music video of "I Stand Alone". To help promote the home video release of the film, Warner Bros. partnered with Act II, American Express, Best Western Hotels, CoinStar, Continental Airlines, Smucker's, and UNICEF, which advertised its trick-or-treat donation boxes before Halloween arrived.


title: Quest for Camelot

text: On Rotten Tomatoes, the film has an approval rating of 45% based on 29 reviews, with an average rating of 5.28/10. The website's critical consensus reads, "Diminished by uneven animation and treacly songs," Quest for Camelot" is an adventure that ought to be tossed back to the Lady in the Lake." On Metacritic, the film has an average score of 50 based on 22 reviews, indicating "mixed or average reviews". Audiences surveyed by CinemaScore gave the film a B+ on a grade scale from A to F.


title: Quest for Camelot

text: Owen Gleiberman, reviewing for "Entertainment Weekly", wrote, "The images are playful and serviceably lush, but the story and characters might have come out of a screenwriting software program, and the songs (sung by Celine Dion and Steve Perry, among others) are Vegas-pop wallpaper." David Kronke of the "Los Angeles Times" described the film as "formulaic" and wrote that it was "a nearly perfect reflection of troubling trends in animated features". He called Kayley "a standard-issue spunky female heroine" and said that "Garrett's blindness is the one adventurous element to the film, but even it seems calculated; his lack of sight is hardly debilitating, yet still provides kids a lesson in acceptance."


title: Quest for Camelot

text: Critical of the story, animation, characters, and music, James Berardinelli of "ReelViews" wrote that the film was "dull, uninspired, and, worst of all, characterized by artwork that could charitably be called 'unimpressive. Stephen Holden of "The New York Times" wrote, "Coming on the heels of 20th Century Fox's lush but silly "Anastasia" (a much better film than this one), "Quest for Camelot" suggests that Disney still owns the artistic franchise on animated features." Kevin J. Harty, an editor of a collection of essays titled "Cinema Arthuriana", says that the film is "slightly indebted to, rather than, as Warner publicity claims, actually based on" Chapman's novel.


title: Quest for Camelot

text: Peter Stack of the "San Francisco Chronicle" said that the film is "a spirited adventure with generous romantic and comic charms" that "aims to please a range of ages, with loopy gags, corny romance, an oversized villain and catchy tunes performed by Celine Dion and LeAnn Rimes, among others." Joe Leydon of "Variety" considered the film as a "lightweight but likable fantasy that offers a playfully feminist twist to Arthurian legends" and noted that the "animation, though not quite up to Disney standards, is impressive enough on its own terms to dazzle the eye and serve the story."


title: Quest for Camelot

text: "Quest for Camelot" grossed $6 million on its opening weekend, ranking third behind "The Horse Whisperer" and "Deep Impact". The film ultimately grossed $22.5 million during its theatrical run in North America. Cumulatively, the film grossed $38.1 million worldwide. The studio lost about $40 million on the film.


title: Quest for Camelot

text: Prior to the release of the film, Warner Bros. had plans to make a stage adaptation of the film that would tour around to different renaissance fairs throughout the United States, as well as a nightly fireworks show for Six Flags Great Adventure. Both shows were designed by SLG Design & Creative Talent and Steve Gilliam.


title: Quest for Camelot

text: The touring aspect of the project was cancelled soon after the film's release due to poor box office performance and the tour's anticipated cost, but the nightly firework show did end up coming to fruition. Quest for Camelot Nights debuted at Six Flags Great Adventure in 1998, and ran through 2001.


title: Quest for Camelot

text: The show told the story of the film, with much of the film's main characters appearing as live characters in the show. The film's musical numbers were acted out with scenes from the film displayed with projections onto the show's "water curtains".


title: Quest for Camelot

text: The Quest for Camelot Audio Action-Adventure was a follow along audiobook based on the film. Released April 7, 1998, the interactive story features two new songs that weren't included in the movie, "Camelot" and "To Be a Knight". Initially announced in 1996, the audiobook was scheduled to be released October 1997, but was delayed until April 1998. The story was narrated by Val Bettin.


title: Quest for Camelot

text: The first video game was titled "Quest for Camelot" and is an action-adventure video game developed and published by Titus Interactive with assistance from Nintendo for the Game Boy Color in 1998. A Nintendo 64 version of the game was planned, but was scrapped due to the film's performance at the box office. The second video game was titled "Quest for Camelot: Dragon Games" is a computer game developed by Knowledge Adventure, it gives the player the ability to explore Camelot after the events of the film. In addition to exploring the world, the player gets to raise a dragon egg and watch it grow.


title: Angela Lee

text: Angela Seung Ju Pucci (née Lee, Chinese: 李胜珠, Korean: 이승주, born July 8, 1996) is a Canadian-American mixed martial artist of Singaporean, Chinese and Korean heritage who is currently competing in ONE Championship.


title: Angela Lee

text: On May 5, 2016, she became the youngest person to ever win a world title in MMA by defeating Mei Yamaguchi to win the ONE Women's Atomweight (115 lbs) Title. Fight Matrix ranks her #13 female MMA Strawweight (105.1-115 lbs) in the world.


title: Angela Lee

text: Lee was born in Vancouver to a Chinese-Singaporean father Ken Lee and a South Korean-born Canadian mother Jewelz Lee. She moved to Hawaii with her family at age 7. Her parents are both martial artists, so she began training at a young age and competing at age 6. Her younger brother Christian is also an MMA fighter and her two other younger siblings, Victoria and Adrian (born in Waipahu), also train in martial arts.


title: Angela Lee

text: In 2011, Angela Lee won her division at the USA Amateur pankration national championships, and the next year, she claimed her division at the World Pangration Athlima Federation world championships in Greece. Lee was awarded her Brazilian Jiu-Jitsu black belt on February 9, 2018, by third-degree black belt Mike Fowler and her father Ken Lee, who is also a black belt.


title: Angela Lee

text: In 2014, Lee made her amateur debut, and in November of that year she won an amateur title by beating Audrey Perkins at Destiny MMA: Na Koa 7 in Honolulu to become the Destiny MMA strawweight champion.


title: Angela Lee

text: Lee signed with ONE Championship in 2014 and made her promotional debut at on May 22, 2015, submitting Aya Saber with an arm bar in the opening round. She competes under both the American and Singaporean flags.


title: Angela Lee

text: Following the win, Lee dropped out of college in Hawaii (she was studying business) and moved to Singapore to join Evolve MMA. In her next fight, she used a rear naked choke hold to beat Mona Samir at on September 27, 2015, in the first round.


title: Angela Lee

text: Lee's third professional fight was at on November 13, 2015, and she submitted Natalie Gonzales Hills with a twister in the opening round in what commentators described as a potential submission of the year contender. She subsequently won the 2015 WMMA Press Award for Submission of the Year.


title: Angela Lee

text: Next, she faced Lena Tkhorevska at on December 11, 2015, and won with a rear naked choke in the second round. Lee's first fight of 2016 was against Rebecca Heintzman at on February 20, 2016, and she won with a second round neck crank.


title: Angela Lee

text: Lee's reward for submitting her first five opponents was a shot at the inaugural ONE Championship Atomweight Women's Title against Japanese veteran Mei Yamaguchi at on May 6, 2016. Winning the fight would make her the youngest-ever MMA world champion.


title: Angela Lee

text: Lee won the fight by unanimous decision to become the inaugural ONE Women's Atomweight Champion, and received a $68,200 SGD bonus for her performance. The MMA media described her fight with Yamaguchi as a Fight of the Year contender. She subsequently signed a new contract with ONE Championship. Commentators speculated that her new contract made Lee the highest paid teenager in the history of MMA, male or female.


title: Angela Lee

text: On March 11, 2017, Angela Lee defeated Jenny Huang of Taiwan and retained the Atomweight World Championship title. On May 27, 2017, she was successful in her second title defense against Istela Nunes of Brazil.


title: Angela Lee

text: On November 8, 2017, Chatri Sityodtong announced that Angela Lee was involved in a serious car accident after she fell asleep at the wheel of her car. She managed to survive the incident with a concussion and minor burns. Lee's bout with Mei Yamaguchi that was scheduled for November 24 has been rescheduled to May 18, 2018, at One Championship Unstoppable Dreams in Singapore. Lee won via unanimous decision.


title: Angela Lee

text: Lee was expected to face reigning strawweight champion Jingnan Xiong at ONE Championship 78: Heart of the Lion on November 9, 2018, in an attempt to become the first female two-division champion in ONE Championship. However, on November 5, 2018, Lee revealed that she was forced off the card due to a back injury. The fight eventually happened on March 31, 2019, at . Lee was defeated via TKO in round 5, which snapped her undefeated streak.


title: Angela Lee

text: At ONE Championship: Masters of Destiny, Angela Lee suffered another defeat at the hands of Michelle Nicolini, via unanimous decision.


title: Angela Lee

text: Lee next defended her ONE Atomweight Championship against Xiong Jingnan – whose Strawweight Championship Lee failed to capture – at on October 13, 2019. She won the fight by submission in the fifth round.


title: Angela Lee

text: After pregnancy leave, Lee returned to defend her Atomweight title against ONE Women's Atomweight Grand Prix winner Stamp Fairtex at on March 26, 2022. Surviving an early scare in the first round after being hurt by a liver punch, she won the bout via submission in the second round.


title: Angela Lee

text: Lee challenged Xiong Jingnan for the ONE Women's Strawweight Championship at on September 30, 2022. She lost the fight by unanimous decision.


title: Angela Lee

text: Lee is married to fellow mixed martial artist Bruno Pucci. On October 1, 2020, Lee announced on her social media that they are expecting a baby, due in April 2021.


title: Angela Lee

text: Both Lee and her husband are head coaches at United BJJ Hawaii, a gym that they founded in 2021. The opening of their gym was delayed by several days as the result of vandalism just prior to the date.


title: Angela Lee

text: Lee's younger brother Christian is the reigning ONE Lightweight World Champion and ONE Welterweight World Champion. Her youngest sibling, Victoria made her successful MMA debut at the age of 16 on February 26, 2021.


title: Bad Wolves

text: Bad Wolves is an American heavy metal band formed in 2017. Initially finding fame from their first single, a cover of the Cranberries' 1994 hit "Zombie", the band proceeded to find further success with a number of songs topping the "Billboard" Mainstream Rock songs chart, including "Remember When", "Killing Me Slowly", and "Sober". The band has released three studio albums, "Disobey" (2018), "N.A.T.I.O.N." (2019) and "Dear Monsters" (2021). In January 2021, original lead vocalist Tommy Vext left the band and was replaced by Daniel "DL" Laskiewicz. Tensions ensued between Vext and the band, resulting in legal proceedings including Better Noise Music.


title: Bad Wolves

text: In July 2014, Boecklin started writing the music that would become the band's debut album and during 2016 entered AudioHammer Studios in Sanford, Florida, with producer Mark Lewis.


title: Bad Wolves

text: Bad Wolves was founded in 2017 by drummer John Boecklin (ex-DevilDriver), vocalist Tommy Vext (ex-Divine Heresy, ex-Westfield Massacre), lead guitarist Doc Coyle (ex-God Forbid), rhythm guitarist Chris Cain (ex-Bury Your Dead, ex-For the Fallen Dreams), and bassist Kyle Konkiel (ex-In This Moment, ex-Scar the Martyr, Vimic). They are managed by Zoltan Bathory of Five Finger Death Punch. The band announced that they would release their debut studio album, "Disobey", on May 11, 2018. Of the thirteen songs in "Disobey", ten were written and recorded before Vext joined the band.


title: Bad Wolves

text: In May 2017, Bad Wolves released their debut single, "Learn to Live". In November 2017, Bad Wolves released their second single, "Toast to the Ghost". On Christmas Eve 2017, the Cranberries' singer Dolores O'Riordan left a text message to her friend, Managing Director of E7LG-Europe, Dan Waite, where she offered to "sing on it", on the cover of "Zombie" that Waite had previously given her to listen to and accredit.


title: Bad Wolves

text: On January 15, 2018, O'Riordan — who was in London for a recording session for her side project's second album, left a voice message to Waite during that night, where she asked him to come in the studio later that morning, and to listen to her vocals on the cover of Bad Wolves. O'Riordan died prior to recording it. On January 18, 2018, they released a third single, which was the cover of "Zombie" (originally by the Cranberries), which charted on multiple "Billboard" charts. The song peaked at number 23 on the "Billboard" 200, and reached number 9 in Australia. It topped the US "Billboard" Mainstream Rock chart. A music video was released on February 22. The band toured with Five Finger Death Punch, Shinedown, Breaking Benjamin, and Starset in the first half of 2018. In October 2018, the band launched a crowdfunding campaign to create a documentary about their formation and rise to fame. The film would be called "Breaking the Band". By the end of the campaign, they had raised under $15,000 of their $65,000 target. Despite this, the band received all the donated money and still intend to create something for the project.


title: Bad Wolves

text: Since their inception, the band has shared the stage with the likes of Five Finger Death Punch, Nickelback, Shinedown, Breaking Benjamin, Papa Roach and Nothing More. They also had their cover of "Zombie" nominated for the iHeartRadio's Rock Song of the Year.


title: Bad Wolves

text: On July 26, 2019, the band released a new single titled "I'll Be There", followed by another single titled "Killing Me Slowly", a third single titled "Sober", as well as a fourth single titled "Crying Game" and announced their new album, "N.A.T.I.O.N.", which was released on October 25, 2019. "Killing Me Slowly" was a song written in collaboration with outside songwriters; however, Vext would later state publicly that he was "the mastermind behind the song" after changing a few lyrics.


title: Bad Wolves

text: Two unreleased singles were released on April 10 on Patreon. The two singles include a cover of "Heart Shaped Box" by Nirvana and a new song called "Shanghai".


title: Bad Wolves

text: In an interview in October 2020, vocalist Vext confirmed that the band had almost completed their third full-length album and that they may release it six months early exclusively via Patreon.


title: Bad Wolves

text: On January 8, 2021, Vext announced his departure from Bad Wolves, with intention to launch his own solo career. On January 9, the band released an official statement saying: "It is true that Bad Wolves and vocalist Tommy Vext have parted ways. The four of us plan to continue making music and a new album is planned for later this year. Tommy has been a big part of Bad Wolves and we are grateful for his contributions". This followed a context in which his support for Donald Trump was criticized, as well as his belief in conspiracy theories stating that Black Lives Matter was "created" by George Soros, the Clinton Foundation, and the media; he also said: "I have not experienced actual racism; it's all manufactured". Previously, Vext was accused of domestic violence by his former girlfriend Whitney Johns. He stated that he was incited to leave Bad Wolves by the four remaining musicians and the label, Better Noise Music, "over his conservative political views".


title: Bad Wolves

text: On May 25, 2021, Tommy Vext claimed via his official Facebook account that Daniel "DL" Laskiewicz (former guitarist of The Acacia Strain) had joined Bad Wolves as their new lead vocalist. Vext followed this up by claiming that "the band is going to have to change its name if they don't pay for the songs I wrote and my trademark ownership but either way wish this dude the best I guess." The band did not respond to Vext's claims at the time. Just over a week later on June 2, 2021, Bad Wolves announced that Laskiewicz had indeed joined the band and that they were working on their third album called "Dear Monsters", which they claimed would be "the best Bad Wolves album to date". The band also elaborated further on Vext's departure, saying that they "disagree with the validity of much of what he has said publicly about our parting of ways – but we would prefer to not look back on the past and instead focus on this new chapter. And most importantly, we'd like to let the music speak for itself." Laskiewicz was involved in the songwriting of "N.A.T.I.O.N."


title: Bad Wolves

text: In July 2021, Doc Coyle stated on an episode of his podcast "The Ex-Man with Doc Coyle" that Vext's continued pressure against Bad Wolves meant that "a big portion of the fanbase has essentially been radicalized against the band under false pretenses." This came in the wake of a lawsuit filed by Vext against Bad Wolves manager Allen Kovac, who is also the CEO of Better Noise Music. In the lawsuit, Vext alleged that Kovac attempted to stop him from making political statements, attempted to buy the trademarks for Bad Wolves off him, tried to strong-arm radio and streaming services into not playing Bad Wolves when Vext refused to sell him the trademarks as a way of pushing Vext out of the music industry, and repeatedly using racial slurs to belittle him. Kovac responded with a statement of his own saying that Vext's accusations were "categorically false". Coyle and John Boecklin also made their own statement where they said that "In all our dealings with Allen Kovac, he has never used any derogatory racial slurs. Tommy is making all of this up. Period."


title: Bad Wolves

text: In late August 2021, Better Noise Music sued Vext for "copyright infringement, breach of contract and unjust enrichment".


title: Bad Wolves

text: The band released the first single from "Dear Monsters", "Lifeline", on September 8. The album was released on October 29, 2021. Vext started a tour starting September 10 and billed himself with his solo band under "Tommy Vext and The B@D W8LV3S". On September 9, 2021, in a statement directed toward Vext, Bad Wolves wrote that "desperate people do desperate things", citing that Vext "can't write his own music" and that he had edited a version of the band's single, "Lifeline", with his singing voice on it that he circulated on the Internet. Bad Wolves cited initiatives Vext has taken since leaving the band in January 2021, including his GoFundMe, which was later shut down for fraud because he attempted to "dupe fans" by inciting them to buy an album of covers to which he does not hold the rights. Bad Wolves described Vext as "abusive − both emotionally and physically" while he was in the band and then afterward when he left it. The band also mentioned his "never-ending temper tantrums" on social media "filled with fraudulent claims and sad attempts to defame members of our band and our team". They said Vext had spread "mountains of lies", that he has "no moral compass", and is willing to do anything to achieve his ends. Vext did not respond directly to Bad Wolves but posted a clip from "" on his social media, which summed up his sentiment.


title: Bad Wolves

text: On April 14, 2022, guitarist Chris Cain announced his departure from the band via Instagram. The following month, it was announced that Max Karon (of Once Human) had joined Bad Wolves as their new rhythm guitarist. Karon had previously worked with Bad Wolves on their first three albums. On July 28, the band released an EP titled "Sacred Kiss".


title: Mullet (fish)

text: The mullets or grey mullets are a family (Mugilidae) of ray-finned fish found worldwide in coastal temperate and tropical waters, and some species in fresh water. Mullets have served as an important source of food in Mediterranean Europe since Roman times. The family includes about 78 species in 20 genera.


title: Mullet (fish)

text: Mullets are distinguished by the presence of two separate dorsal fins, small triangular mouths, and the absence of a lateral line organ. They feed on detritus, and most species have unusually muscular stomachs and a complex pharynx to help in digestion.


title: Mullet (fish)

text: Taxonomically, the family is currently treated as the sole member of the order Mugiliformes, but as Nelson says, "there has been much disagreement concerning the relationships" of this family. The presence of fin spines clearly indicates membership in the superorder Acanthopterygii, and in the 1960s, they were classed as primitive perciforms, while others have grouped them in Atheriniformes. They are classified as an order, Mugiliformes, within the subseries Ovalentaria of the clade Percomorpha in the 5th Edition of "Fishes of the World".


title: Mullet (fish)

text: In North America, "mullet" by itself usually refers to Mugilidae. In Europe, the word "mullet" is usually qualified, the "grey mullets" being Mugilidae and the "red mullets" or "surmullets" being Mullidae, notably members of the genus "Mullus". Outside Europe, the Mullidae are often called "goatfish". Fish with common names including the word "mullet" may be a member of one family or the other, or even unrelated such as the freshwater white sucker ("Catostomus commersonii").


title: Mullet (fish)

text: However, recent taxonomic work has reorganised the family and the following genera make up the Mugilidae:


title: Mullet (fish)

text: A common noticeable behaviour in mullet is the tendency to leap out of the water. There are two distinguishable types of leaps: a straight, clean slice out of the water to escape predators and a slower, lower jump while turning to its side that results in a larger, more distinguishable, splash. The reasons for this lower jump are disputed, but have been hypothesised to be in order to gain oxygen rich air for gas exchange in a small organ above the pharynx.


title: Mullet (fish)

text: The ontogeny of mugilid larvae has been well studied, with the larval development of "Mugil cephalus" in particular being studied intensively due to its wide range of distribution and interest to aquaculture. The previously understudied osteological development of "Mugil cephalus" was investigated in a 2021 study, with four embryonic and six larval developmental steps being described in aquaculture-reared and wild-caught specimens. These descriptions provided clarification of questionable characters of adult mullets and revealed informative details with potential implications for phylogenetic hypotheses, as well as providing an overdue basis of comparison for aquaculture-reared mullets to enable recognition of malformations.


title: Le Monde's 100 Books of the Century

text: The 100 Books of the Century () is a list of the one hundred most memorable books of the 20th century, according to a poll performed during the spring of 1999 by the French retailer Fnac and the Paris newspaper "Le Monde".


title: Le Monde's 100 Books of the Century

text: Starting from a preliminary list of 200 titles created by bookshops and journalists, 17,000 French participants responded to the question, "Which books have remained in your memory?" ("Quels livres sont restés dans votre mémoire?").


title: Le Monde's 100 Books of the Century

text: The list includes both classic novels and genre fiction (Tolkien, Agatha Christie, A. C. Doyle), as well as poetry, drama and nonfiction literature (Freud's essays and the diary of Anne Frank). There are also comic books on the list, one album from each of these five francophone or italian series: "Asterix", "Tintin", "Blake and Mortimer", "Gaston" and "Corto Maltese". The large number of French novels of the list is due to the demographics of the surveyed group.


title: Le Monde's 100 Books of the Century

text: Likewise, comparable lists by English language sources—such as the two lists of Modern Library 100 Best Novels published in 1998, one by the Board of the Modern Library and the other by readers who responded—disproportionately favour British and American authors. Non-English language works were not eligible for the two Modern Library lists.


title: Le Monde's 100 Books of the Century

text: Note: Classified by the language of the book's first publication, which might not be the author's principal language.


title: Race condition

text: A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of the possible behaviors is undesirable.


title: Race condition

text: The term "race condition" was already in use by 1954, for example in David A. Huffman's doctoral thesis "The synthesis of sequential switching circuits".


title: Race condition

text: Race conditions can occur especially in logic circuits, multithreaded, or distributed software programs.


title: Race condition

text: A typical example of a race condition may occur when a logic gate combines signals that have traveled along different paths from the same source. The inputs to the gate can change at slightly different times in response to a change in the source signal. The output may, for a brief period, change to an unwanted state before settling back to the designed state. Certain systems can tolerate such glitches but if this output functions as a clock signal for further systems that contain memory, for example, the system can rapidly depart from its designed behaviour (in effect, the temporary glitch becomes a permanent glitch).


title: Race condition

text: Consider, for example, a two-input AND gate fed with the following logic: formula_1A logic signal formula_2 on one input and its negation, formula_3 (the ¬ is a boolean negation), on another input in theory never output a true value: formula_4. If, however, changes in the value of formula_2 take longer to propagate to the second input than the first when formula_2 changes from false to true then a brief period will ensue during which both inputs are true, and so the gate's output will also be true.


title: Race condition

text: A "critical race condition" occurs when the order in which internal variables are changed determines the eventual state that the state machine will end up in.


title: Race condition

text: A "non-critical race condition" occurs when the order in which internal variables are changed does not determine the eventual state that the state machine will end up in.


title: Race condition

text: A "dynamic race condition" occurs when it results in multiple transitions when only one is intended. They are due to interaction between gates. It can be eliminated by using no more than two levels of gating.


title: Race condition

text: An "essential race condition" occurs when an input has two transitions in less than the total feedback propagation time. Sometimes they are cured using inductive delay line elements to effectively increase the time duration of an input signal.


title: Race condition

text: Design techniques such as Karnaugh maps encourage designers to recognize and eliminate race conditions before they cause problems. Often logic redundancy can be added to eliminate some kinds of races.


title: Race condition

text: As well as these problems, some logic elements can enter metastable states, which create further problems for circuit designers.


title: Race condition

text: A race condition can arise in software when a computer program has multiple code paths that are executing at the same time. If the multiple code paths take a different amount of time than expected, they can finish in a different order than expected, which can cause software bugs due to unanticipated behavior. A race can also occur between two programs, resulting in security issues (see below.)


title: Race condition

text: Critical race conditions cause invalid execution and software bugs. Critical race conditions often happen when the processes or threads depend on some shared state. Operations upon shared states are done in critical sections that must be mutually exclusive. Failure to obey this rule can corrupt the shared state.


title: Race condition

text: A data race is a type of race condition. Data races are important parts of various formal memory models. The memory model defined in the C11 and C++11 standards specify that a C or C++ program containing a data race has undefined behavior.


title: Race condition

text: A race condition can be difficult to reproduce and debug because the end result is nondeterministic and depends on the relative timing between interfering threads. Problems of this nature can therefore disappear when running in debug mode, adding extra logging, or attaching a debugger. A bug that disappears like this during debugging attempts is often referred to as a "Heisenbug". It is therefore better to avoid race conditions by careful software design.


title: Race condition

text: Assume that two threads each increment the value of a global integer variable by 1. Ideally, the following sequence of operations would take place:


title: Race condition

text: In the case shown above, the final value is 2, as expected. However, if the two threads run simultaneously without locking or synchronization, the outcome of the operation could be wrong. The alternative sequence of operations below demonstrates this scenario:


title: Race condition

text: In this case, the final value is 1 instead of the expected result of 2. This occurs because here the increment operations are not mutually exclusive. Mutually exclusive operations are those that cannot be interrupted while accessing some resource such as a memory location.


title: Race condition

text: Not all regard data races as a subset of race conditions. The precise definition of data race is specific to the formal concurrency model being used, but typically it refers to a situation where a memory operation in one thread could potentially attempt to access a memory location at the same time that a memory operation in another thread is writing to that memory location, in a context where this is dangerous. This implies that a data race is different from a race condition as it is possible to have nondeterminism due to timing even in a program without data races, for example, in a program in which all memory accesses use only atomic operations.


title: Race condition

text: This can be dangerous because on many platforms, if two threads write to a memory location at the same time, it may be possible for the memory location to end up holding a value that is some arbitrary and meaningless combination of the bits representing the values that each thread was attempting to write; this could result in memory corruption if the resulting value is one that neither thread attempted to write (sometimes this is called a 'torn write'). Similarly, if one thread reads from a location while another thread is writing to it, it may be possible for the read to return a value that is some arbitrary and meaningless combination of the bits representing the value that the memory location held before the write, and of the bits representing the value being written.


title: Race condition

text: On many platforms, special memory operations are provided for simultaneous access; in such cases, typically simultaneous access using these special operations is safe, but simultaneous access using other memory operations is dangerous. Sometimes such special operations (which are safe for simultaneous access) are called "atomic" or "synchronization" operations, whereas the ordinary operations (which are unsafe for simultaneous access) are called "data" operations. This is probably why the term is "data" race; on many platforms, where there is a race condition involving only "synchronization" operations, such a race may be nondeterministic but otherwise safe; but a "data" race could lead to memory corruption or undefined behavior.


title: Race condition

text: The precise definition of data race differs across formal concurrency models. This matters because concurrent behavior is often non-intuitive and so formal reasoning is sometimes applied.


title: Race condition

text: The "C++ standard", in draft N4296 (2014-11-19), defines data race as follows in section 1.10.23 (page 14)


title: Race condition

text: The execution of a program contains a "data race" if it contains two potentially concurrent conflicting actions, at least one of which is not atomic, and neither happens before the other, except for the special case for signal handlers described below [omitted]. Any such data race results in undefined behavior.


title: Race condition

text: The parts of this definition relating to signal handlers are idiosyncratic to C++ and are not typical of definitions of "data race".


title: Race condition

text: "two memory operations "conflict" if they access the same location and at least one of them is a write operation...


title: Race condition

text: "Two memory operations, x and y, in a sequentially consistent execution form a race 〈x,y〉, iff x and y conflict, and they are not ordered by the hb1 relation of the execution. The race 〈x,y〉, is a "data race" iff at least one of x or y is a data operation.


title: Race condition

text: The hb1 relation is defined elsewhere in the paper, and is an example of a typical "happens-before" relation; intuitively, if we can prove that we are in a situation where one memory operation X is guaranteed to be executed to completion before another memory operation Y begins, then we say that "X happens-before Y". If neither "X happens-before Y" nor "Y happens-before X", then we say that X and Y are "not ordered by the hb1 relation". So, the clause "...and they are not ordered by the hb1 relation of the execution" can be intuitively translated as "...and X and Y are potentially concurrent".


title: Race condition

text: The paper considers dangerous only those situations in which at least one of the memory operations is a "data operation"; in other parts of this paper, the paper also defines a class of "synchronization operations" which are safe for potentially simultaneous use, in contrast to "data operations".


title: Race condition

text: Two accesses to (reads of or writes to) the same variable are said to be conflicting if at least one of the accesses is a write...When a program contains two conflicting accesses (§17.4.1) that are not ordered by a happens-before relationship, it is said to contain a data race...a data race cannot cause incorrect behavior such as returning the wrong length for an array.


title: Race condition

text: A critical difference between the C++ approach and the Java approach is that in C++, a data race is undefined behavior, whereas in Java, a data race merely affects "inter-thread actions". This means that in C++, an attempt to execute a program containing a data race could (while still adhering to the spec) crash or could exhibit insecure or bizarre behavior, whereas in Java, an attempt to execute a program containing a data race may produce undesired concurrency behavior but is otherwise (assuming that the implementation adheres to the spec) safe.


title: Race condition

text: An important facet of data races is that in some contexts, a program that is free of data races is guaranteed to execute in a sequentially consistent manner, greatly easing reasoning about the concurrent behavior of the program. Formal memory models that provide such a guarantee are said to exhibit an "SC for DRF" (Sequential Consistency for Data Race Freedom) property. This approach has been said to have achieved recent consensus (presumably compared to approaches which guarantee sequential consistency in all cases, or approaches which do not guarantee it at all).


title: Race condition

text: A program is correctly synchronized if and only if all sequentially consistent executions are free of data races.


title: Race condition

text: If a program is correctly synchronized, then all executions of the program will appear to be sequentially consistent (§17.4.3).


title: Race condition

text: "This is an extremely strong guarantee for programmers. Programmers do not need to reason about reorderings to determine that their code contains data races. Therefore they do not need to reason about reorderings when determining whether their code is correctly synchronized. Once the determination that the code is correctly synchronized is made, the programmer does not need to worry that reorderings will affect his or her code."


title: Race condition

text: "A program must be correctly synchronized to avoid the kinds of counterintuitive behaviors that can be observed when code is reordered. The use of correct synchronization does not ensure that the overall behavior of a program is correct. However, its use does allow a programmer to reason about the possible behaviors of a program in a simple way; the behavior of a correctly synchronized program is much less dependent on possible reorderings. Without correct synchronization, very strange, confusing and counterintuitive behaviors are possible."


title: Race condition

text: By contrast, a draft C++ specification does not directly require an SC for DRF property, but merely observes that there exists a theorem providing it:


title: Race condition

text: [Note:It can be shown that programs that correctly use mutexes and memory_order_seq_cst operations to prevent all data races and use no other synchronization operations behave as if the operations executed by their constituent threads were simply interleaved, with each value computation of an object being taken from the last side effect on that object in that interleaving. This is normally referred to as “sequential consistency”. However, this applies only to data-race-free programs, and data-race-free programs cannot observe most program transformations that do not change single-threaded program semantics. In fact, most single-threaded program transformations continue to be allowed, since any program that behaves differently as a result must perform an undefined operation.— end note


title: Race condition

text: Note that the C++ draft specification admits the possibility of programs that are valid but use synchronization operations with a memory_order other than memory_order_seq_cst, in which case the result may be a program which is correct but for which no guarantee of sequentially consistency is provided. In other words, in C++, some correct programs are not sequentially consistent. This approach is thought to give C++ programmers the freedom to choose faster program execution at the cost of giving up ease of reasoning about their program.


title: Race condition

text: There are various theorems, often provided in the form of memory models, that provide SC for DRF guarantees given various contexts. The premises of these theorems typically place constraints upon both the memory model (and therefore upon the implementation), and also upon the programmer; that is to say, typically it is the case that there are programs which do not meet the premises of the theorem and which could not be guaranteed to execute in a sequentially consistent manner.


title: Race condition

text: The DRF1 memory model provides SC for DRF and allows the optimizations of the WO (weak ordering), RCsc (Release Consistency with sequentially consistent special operations), VAX memory model, and data-race-free-0 memory models. The PLpc memory model provides SC for DRF and allows the optimizations of the TSO (Total Store Order), PSO, PC (Processor Consistency), and RCpc (Release Consistency with processor consistency special operations) models. DRFrlx provides a sketch of an SC for DRF theorem in the presence of relaxed atomics.


title: Race condition

text: Many software race conditions have associated computer security implications. A race condition allows an attacker with access to a shared resource to cause other actors that utilize that resource to malfunction, resulting in effects including denial of service and privilege escalation.


title: Race condition

text: A specific kind of race condition involves checking for a predicate (e.g. for authentication), then acting on the predicate, while the state can change between the "time of check" and the "time of use". When this kind of bug exists in security-sensitive code, a security vulnerability called a time-of-check-to-time-of-use ("TOCTTOU") bug is created.


title: Race condition

text: Race conditions are also intentionally used to create hardware random number generators and physically unclonable functions. PUFs can be created by designing circuit topologies with identical paths to a node and relying on manufacturing variations to randomly determine which paths will complete first. By measuring each manufactured circuit's specific set of race condition outcomes, a profile can be collected for each circuit and kept secret in order to later verify a circuit's identity.


title: Race condition

text: Two or more programs may collide in their attempts to modify or access a file system, which can result in data corruption or privilege escalation. File locking provides a commonly used solution. A more cumbersome remedy involves organizing the system in such a way that one unique process (running a daemon or the like) has exclusive access to the file, and all other processes that need to access the data in that file do so only via interprocess communication with that one process. This requires synchronization at the process level.


title: Race condition

text: A different form of race condition exists in file systems where unrelated programs may affect each other by suddenly using up available resources such as disk space, memory space, or processor cycles. Software not carefully designed to anticipate and handle this race situation may then become unpredictable. Such a risk may be overlooked for a long time in a system that seems very reliable. But eventually enough data may accumulate or enough other software may be added to critically destabilize many parts of a system. An example of this occurred with the near loss of the Mars Rover "Spirit" not long after landing. A solution is for software to request and reserve all the resources it will need before beginning a task; if this request fails then the task is postponed, avoiding the many points where failure could have occurred. Alternatively, each of those points can be equipped with error handling, or the success of the entire task can be verified afterwards, before continuing. A more common approach is to simply verify that enough system resources are available before starting a task; however, this may not be adequate because in complex systems the actions of other running programs can be unpredictable.


title: Race condition

text: In networking, consider a distributed chat network like IRC, where a user who starts a channel automatically acquires channel-operator privileges. If two users on different servers, on different ends of the same network, try to start the same-named channel at the same time, each user's respective server will grant channel-operator privileges to each user, since neither server will yet have received the other server's signal that it has allocated that channel. (This problem has been largely solved by various IRC server implementations.)


title: Race condition

text: In this case of a race condition, the concept of the "shared resource" covers the state of the network (what channels exist, as well as what users started them and therefore have what privileges), which each server can freely change as long as it signals the other servers on the network about the changes so that they can update their conception of the state of the network. However, the latency across the network makes possible the kind of race condition described. In this case, heading off race conditions by imposing a form of control over access to the shared resource—say, appointing one server to control who holds what privileges—would mean turning the distributed network into a centralized one (at least for that one part of the network operation).


title: Race condition

text: Race conditions can also exist when a computer program is written with non-blocking sockets, in which case the performance of the program can be dependent on the speed of the network link.


title: Race condition

text: Software flaws in life-critical systems can be disastrous. Race conditions were among the flaws in the Therac-25 radiation therapy machine, which led to the death of at least three patients and injuries to several more.


title: Race condition

text: Another example is the energy management system provided by GE Energy and used by Ohio-based FirstEnergy Corp (among other power facilities). A race condition existed in the alarm subsystem; when three sagging power lines were tripped simultaneously, the condition prevented alerts from being raised to the monitoring technicians, delaying their awareness of the problem. This software flaw eventually led to the North American Blackout of 2003. GE Energy later developed a software patch to correct the previously undiscovered error.


title: Race condition

text: Many software tools exist to help detect race conditions in software. They can be largely categorized into two groups: static analysis tools and dynamic analysis tools.


title: Race condition

text: Thread Safety Analysis is a static analysis tool for annotation-based intra-procedural static analysis, originally implemented as a branch of gcc, and now reimplemented in Clang, supporting PThreads.


title: Race condition

text: In UK railway signalling, a race condition would arise in the carrying out of Rule 55. According to this rule, if a train was stopped on a running line by a signal, the locomotive fireman would walk to the signal box in order to remind the signalman that the train was present. In at least one case, at Winwick in 1934, an accident occurred because the signalman accepted another train before the fireman arrived. Modern signalling practice removes the race condition by making it possible for the driver to instantaneously contact the signal box by radio.


title: History of Hungary

text: Hungary in its modern (post-1946) borders roughly corresponds to the Great Hungarian Plain (the Pannonian Basin). During the Iron Age, it was located at the crossroads between the cultural spheres of the Celtic tribes (such as the Scordisci, Boii and Veneti), Dalmatian tribes (such as the Dalmatae, Histri and Liburni) and the Germanic tribes (such as the Lugii and Marcomanni).


title: History of Hungary

text: The name "Pannonian" comes from Pannonia, a province of the Roman Empire. Only the western part of the territory (the so-called Transdanubia) of modern Hungary formed part of Pannonia. The Roman control collapsed with the Hunnic invasions of 370–410, and Pannonia was part of the Ostrogothic Kingdom during the late 5th to mid 6th century, succeeded by the Avar Khaganate (6th to 9th centuries). The Magyar invasion took place during the 9th century.


title: History of Hungary

text: The Magyars were Christianized at the end of the 10th century, and the Christian Kingdom of Hungary was established in AD 1000, ruled by the Árpád dynasty for the following three centuries. In the high medieval period, the kingdom expanded beyond Pannonia, to the Adriatic coast. In 1241 during the reign of Béla IV, Hungary was invaded by the Mongols under Batu Khan. The outnumbered Hungarians were decisively defeated at the Battle of Mohi by the Mongol army. King Béla fled to the Holy Roman Empire and left the Hungarian population at the mercy of the Mongols. In this invasion more than 500,000 Hungarian people were massacred and the whole kingdom reduced to ashes. After the extinction of the Árpád dynasty in 1301, the late medieval kingdom persisted, albeit no longer under Hungarian monarchs and gradually reduced by increasing pressure from the expansion of the Ottoman Empire. Hungary bore the brunt of the Ottoman wars in Europe during the 15th century. The peak of this struggle took place during the reign of Matthias Corvinus (r. 1458–1490). The Ottoman–Hungarian wars concluded in significant loss of territory and the partition of the kingdom after the Battle of Mohács of 1526.


title: History of Hungary

text: Defense against Ottoman expansion shifted to Habsburg Austria, and the remainder of the Hungarian kingdom came under the rule of the Habsburg emperors. The lost territory was recovered with the conclusion of the Great Turkish War, thus the whole of Hungary became part of the Habsburg monarchy. Following the nationalist uprisings of 1848, the Austro-Hungarian Compromise of 1867 elevated Hungary's status by the creation of a joint monarchy. The territory grouped under the Habsburg "Archiregnum Hungaricum" was much larger than modern Hungary, following the Croatian–Hungarian Settlement of 1868 which settled the political status of the Kingdom of Croatia-Slavonia within the Lands of the Crown of Saint Stephen.


title: History of Hungary

text: After the first World War, the Central Powers enforced the dissolution of the Habsburg monarchy. The treaties of Saint-Germain-en-Laye and Trianon detached around 72% of the territory of the Kingdom of Hungary, which was ceded to Czechoslovakia, the Kingdom of Romania, the Kingdom of Serbs, Croats and Slovenes, the First Austrian Republic, the Second Polish Republic and the Kingdom of Italy. Afterwards a short-lived People's Republic was declared. It was followed by a restored Kingdom of Hungary but was governed by a regent, Miklós Horthy. He officially represented the Hungarian monarchy of Charles IV, Apostolic King of Hungary, who was held in captivity during his last months at Tihany Abbey. Between 1938 and 1941, Hungary recovered part of her lost territories. During World War II Hungary came under German occupation in 1944, then under Soviet occupation until the end of the war. After World War II, the Second Hungarian Republic was established within Hungary's current-day borders as a socialist People's Republic, lasting from 1949 to the end of communism in Hungary in 1989. The Third Republic of Hungary was established under an amended version of the constitution of 1949, with a new constitution adopted in 2011. Hungary joined the European Union in 2004.


title: History of Hungary

text: Middle Paleolithic presence of "Homo heidelbergensis" is evidenced by the discovery of the "Samu" fossil, dated to c. 300,000 years ago, with traces of habitation as old as 500,000 years ago. Presence of anatomically modern humans dates to c. 33,000 years ago (Aurignacian). Neolithization began with the Starčevo–Kőrös–Criș culture, c. 6000 BC. The Bronze Age began with the Vučedol culture (Makó culture), c. 3000 BC.


title: History of Hungary

text: The Iron Age commenced around 800 BC, associated with "Thraco-Cimmerian" artefact types, representing the overlap of the pre-Scythian (Novocherkassk culture) and pre-Celtic (Hallstatt culture) cultural spheres. Hallstatt occupation of western Transdanubia is evident from about 750 BC. Early Greek ethnography locates the Agathyrsi and the Sigynnae in the region. By the 4th century BC, the Pannonian Basin was occupied by Pannonians (assumed to be an Illyrian tribal confederation) and by Celts (Taurisci). Following 279 BC, the Celtic Scordisci settled in southern Transdanubia after their defeat at Delphi. The northeastern part of the basin was reached by the Boii in the 2nd century BC.


title: History of Hungary

text: The Roman Empire conquered territory west of the Danube River between 35 and 9 BC. From 9 BC to the end of the 4th century AD, Pannonia, the western part of the Carpathian Basin, was part of the Roman Empire. In the final stages of the expansion of the Roman Empire in the early centuries of the first millennium AD, the Carpathian Basin fell under the Mediterranean influence of Greco-Roman civilization for a short period—town centers, paved roads, and written sources were all part of the advances put to an end by the "migration of peoples" that characterized the Early Middle Ages in Europe. The Goths established themselves in Dacia by the 4th century.


title: History of Hungary

text: After the Western Roman Empire collapsed in the 5th century AD under the stress of the migration of Germanic tribes and Carpian pressure, the Migration Period continued to bring many invaders into central Europe, beginning with the Hunnic Empire (c. 370–469). After the disintegration of Hunnic rule, the Ostrogoths, who had been vassalized by the Huns, established their own Ostrogothic Kingdom. Other groups which reached the Carpathian Basin in the Migration Period were the Gepids, Lombards and Slavs. In the 560s, the Avars founded the Avar Khaganate, a state that maintained supremacy in the region for more than two centuries and had the military power to launch attacks against its neighboring empires. The Avar Khaganate was weakened by constant wars and outside pressure, and the Franks under Charlemagne defeated the Avars in a series of campaigns during the 790s. By the mid-9th century, the Balaton Principality, also known as Lower Pannonia, was established as a Frankish march.


title: History of Hungary

text: In 803 Krum became khan of Bulgaria. The new energetic ruler pointed his attention to the north-west where Bulgaria's old enemies, the Avars, experienced difficulties and setbacks against the Franks under Charlemagne. Between 804 and 806 the Bulgarian armies militarily annihilated the Avars and destroyed their state. Krum took the eastern parts of the former Avar Khaganate and took over rule of the local Slavic tribes. Bulgaria's territory extended twice from the middle Danube to the north of Budapest to the Dniester though possession of Transylvania is debatable. In 813 Khan Krum seized Odrin and plundered the whole of East Thrace. He took 50,000 captives who were settled in Bulgaria across the Danube.


title: History of Hungary

text: The Hungarians migrated into the Carpathian Basin in the late ninth century, the first certain mention of them living in the region dates to 862. The conquest proper started from 894, when armed conflicts opened with the Bulgarians and Moravians after the requests for help from Arnulf, Frankish king and Leo VI, Byzantine emperor. During the occupation, the Hungarians found sparse population and met no well-established states or effective control of any empire in the plain. They were able to take over the basin quickly, defeating the First Bulgarian Tsardom, disintegrating the Principality of Moravia, and firmly establishing their state there by 900. The invasion wasn't aimed at plundering the acquired lands as attacks were led by "gyula" Árpád and "kende" Kurszán, the two highest-ranking leaders, who left no mass graves behind them showing that the transition back to an Avar-like system was peaceful for the locals. Archaeological findings indicate that they settled in the lands near the Sava and Nyitra by this time. The military power of the nation allowed the Hungarians to conduct successful fierce campaigns as far as the territories of modern Spain. A defeat at the Battle of Lechfeld in 955 signaled an end to raids on western territories, although they continued into lands controlled by the Byzantine Empire until 970, and links between the tribes weakened. Prince () Géza of the Árpád dynasty, who ruled only part of the united territory, was the nominal overlord of all seven Magyar tribes. He aimed to integrate Hungary into Christian Western Europe .


title: History of Hungary

text: The name "Hungary" derives from the designation for the Magyars, first recorded in Byzantine sources of the 9th century (in the 10th century as Latin ). The initial "H-" is a non-phonemic addition made in Middle Latin, first used in the late 12th century. According to one explanation, the name ultimately reflects a Byzantine loan of the Old Bulgarian , itself from the Old Turkic name of the ("ten tribes") confederation. During the Middle Ages, Byzantine sources also referred to the Magyar state as Tourkia (Turkey) ().Géza established a dynasty by naming his son Vajk (later King Stephen I of Hungary) as his successor. This decision was contrary to the dominant tradition of the time to have the eldest surviving member of the ruling family succeed the incumbent. By ancestral right, Prince Koppány, the oldest member of the dynasty, should have claimed the throne, but Géza chose his first-born son to be his successor instead. After Géza's death in 997, Koppány took up arms, and many subjects in Transdanubia joined him. The rebels claimed to represent the old political order, ancient human rights, tribal independence and pagan belief. Stephen won a decisive victory over Koppány and had him executed.


title: History of Hungary

text: Hungary was recognized as an Apostolic Kingdom under Saint Stephen I. According to later Hungarian tradition, Stephen was crowned with the Holy Crown of Hungary on the first day of the second millennium in the capital city of Esztergom. Pope Sylvester II conferred on him the right to have the cross carried before him, with full administrative authority over bishoprics and churches. By 1006, Stephen had solidified his power by eliminating all rivals who either wanted to follow the old pagan traditions or wanted an alliance with the Eastern Christian Byzantine Empire. Stephen established a network of ten episcopal and two archiepiscopal sees, and ordered the buildup of monasteries, churches and cathedrals. In the earliest times, the Hungarian language, part of the Uralic languages family, was written in a runic-like script. The country switched to the Latin alphabet under Stephen, and Latin was the official language of the country between 1000 and 1844. Stephen followed the Frankish administrative model. The whole of this land was divided into counties ("megyék"), each under a royal official called an "ispán" (equivalent to the title count, ), later "főispán" (). This official represented the king's authority, administered his subjects, and collected the taxes that formed the national revenue. Each "ispán" maintained an armed force of freemen at his fortified headquarters ("castrum" or "vár").


title: History of Hungary

text: After the Great Schism between Western Roman Catholic and Eastern Orthodox Christianity was formalized in 1054, Hungary viewed itself as the easternmost bastion of Western civilisation, a judgment affirmed in the 15th century by Pope Pius II, who expressed himself to Holy Roman Emperor Frederick III in these terms: "Hungary is the shield of Christianity and the protector of Western civilization".


title: History of Hungary

text: The Árpád dynasty produced monarchs throughout the 12th and 13th centuries. King Béla III (r. 1172–1196) was the wealthiest and most powerful member of the dynasty, with an annual equivalent of 23,000 kg of pure silver at his disposal. This exceeded the resources of the French king (estimated at some 17,000 kilograms) and was double the amount available to the English Crown. In 1195, Béla expanded the Hungarian kingdom southward and westward to Bosnia and Dalmatia and extended suzerainty over Serbia, a process that helped to break up the Byzantine Empire and diminish its influence in the Balkan region.


title: History of Hungary

text: The early 13th century in Hungary was distinguished by the reign of King Andrew II, who acceded to the throne in 1205 and died in 1235. In 1211, he granted the Burzenland (in Transylvania) to the Teutonic Knights but in 1225 expelled them from Transylvania, hence the Teutonic Order had to transfer to the Baltic Sea. Andrew set up the largest royal army in the history of the Crusades (20,000 knights and 12,000 castle-garrisons) when he led the Fifth Crusade to the Holy Land in 1217. In 1224, he issued the Diploma Andreanum, which unified and ensured the special privileges of the Transylvanian Saxons.


title: History of Hungary

text: Andrew II was forced to accept the Golden Bull of 1222, which was the Hungarian equivalent of England's Magna Carta to which every Hungarian king thereafter had to swear. The Golden Bull had a twofold purpose that limited royal power. On the one hand, it reaffirmed the rights of the smaller nobles of the old and new classes of royal servants ("servientes regis") against both the crown and the magnates. On the other hand, it defended the rights of the whole nation against the crown by restricting the powers of the latter in certain fields and making refusal to obey its unlawful/unconstitutional commands (the "ius resistendi") legal. The lesser nobles also began to present Andrew with grievances, a practice that evolved into the institution of the Parliament, or Diet. Hungary became the first country in which a parliament had supremacy over the kingship. The most important legal ideology was the Doctrine of the Holy Crown. The most important principle of the doctrine was the belief that sovereignty belonged to the noble nation (as represented by the Holy Crown). The members of the Holy Crown were the citizens of the Crown's lands, and no citizen could attain absolute power over the others. The nation would share only some political power with the ruler.


title: History of Hungary

text: In 1241–1242, the kingdom suffered a major blow in the wake of the Mongol invasion of Europe. After Hungary was invaded by the Mongols in 1241, the Hungarian army was defeated disastrously at the Battle of Mohi. King Béla IV fled the battlefield and then the country after the Mongols pursued him to its borders. Before the Mongols retreated, a large part of the population (20-50%) died. In the plains, between 50 and 80% of the settlements were destroyed. Only castles, strongly fortified cities and abbeys could withstand the assault, as the Mongols had no time for long sieges—their goal was to move west as soon as possible. The siege engines and the Chinese and Persian engineers that operated them for the Mongols had been left in the conquered lands of Kyivan Rus'. The devastation caused by the Mongol invasions later led to the invitation of settlers from other parts of Europe, especially from Germany.


title: History of Hungary

text: During the Mongols' campaign against Kievan Rus, some 40,000 Cumans, members of a nomadic tribe of pagan Kipchaks, were driven west of the Carpathian Mountains. There, the Cumans appealed to King Béla IV for protection. The Iranian Jassic people came to Hungary together with the Cumans after they were defeated by the Mongols. Cumans constituted perhaps up to 7–8% of the population of Hungary in the second half of the 13th century. Over the centuries they were fully assimilated into the Hungarian population, and their language disappeared, but they preserved their identity and their regional autonomy until 1876.


title: History of Hungary

text: As a consequence of the Mongol invasions, King Béla ordered the construction of hundreds of stone castles and fortifications to help defend against a possible second Mongol invasion. The Mongols did indeed return to Hungary in 1286, but the newly built stone-castle systems and new military tactics involving a higher proportion of heavily armed knights stopped them. The invading Mongol force was defeated near Pest by the royal army of King Ladislaus IV. Later invasions were also repelled handily. The castles built by Béla IV proved to be very useful at a later time in the long struggle against the Ottoman Empire. However, the cost of building them indebted the Hungarian king to the major feudal landlords, so that the royal power reclaimed by Béla IV after his father Andrew II significantly weakened it was once again dispersed among the lesser nobility.


title: History of Hungary

text: After a destructive period of interregnum (1301–1308), the first Angevin king of Hungary, Charles I ("Charles the Great") successfully restored royal power and defeated oligarchic rivals known as the "little kings". A descendant of the Árpád dynasty in the female line, he reigned between 1308 and 1342. His new fiscal, customs and monetary policies proved successful.


title: History of Hungary

text: One of the primary sources of the new king's power was the wealth derived from the gold mines of eastern and northern Hungary. Production eventually reached the remarkable figure of 3,000 lb. (1350 kg) of gold annually—one-third of the total production of the world as then known and five times as much as that of any other European state. Charles also sealed an alliance with Polish King Casimir the Great. After Italy, Hungary was the first European country in which the Renaissance appeared. One sign of its progressiveness was the establishment of a printing press in Buda in 1472 by András Hess, one of the earliest outside of the German lands.


title: History of Hungary

text: Louis the Great (r. 1342–1382), the second Hungarian king of the Angevin line, extended his rule as far as the Adriatic Sea and occupied the Kingdom of Naples several times. In 1351, the Golden Bull of 1222 was completed with a law of entail. This stipulated that the nobles' hereditary lands could not be taken away and must remain in the possession of their families. Louis became king of Poland from 1370 to 1382. The epic hero of Hungarian literature and warfare, the king's champion Miklós Toldi lived during his reign. Louis had become popular in Poland because of his campaign against the Tatars and pagan Lithuanians. In two successful wars against Venice (1357–1358 and 1378–1381), he was able to annex Dalmatia, Ragusa and other territories on the Adriatic Sea. Venice was also required to raise the Angevin flag in St. Mark's Square on holy days. Louis retained his strong influence in the political life of the Italian Peninsula for the rest of his life.


title: History of Hungary

text: Some Balkan states (such as Wallachia, Moldova, Serbia, and Bosnia) became his vassals while the Ottoman Turks confronted them ever more often. In 1366 and 1377, Louis led successful campaigns against the Ottomans (such as the Battle of Nicapoli in 1366). From the time of the death of Casimir the Great in 1370, he was also king of Poland. In cultural affairs, he is notable for establishing a university in Pécs in 1367.


title: History of Hungary

text: King Louis died without a male heir, and after years of civil war, the future Holy Roman Emperor Sigismund (r. 1387–1437), a prince of the Luxembourg line, succeeded to the throne by marrying the daughter of Louis the Great, Mary of Hungary (who was herself crowned a "king" in 1382), becoming an official co-ruler and consolidating his power. It was not for entirely selfless reasons that one of the leagues of barons helped him to power: Sigismund had to pay for the support of the lords by transferring a sizeable part of the royal properties. For some years, the baron's council governed the country in the name of the Holy Crown; the king was even imprisoned for a short time. The restoration of the authority of the central administration took decades. After Mary's death, Sigismund ruled as a sole ruler for life.


title: History of Hungary

text: In 1404, Sigismund introduced the "Placetum Regnum". According to this decree, Papal bulls and messages could not be pronounced in Hungary without the consent of the king. Sigismund summoned the Council of Constance that met between 1414 and 1418 to abolish the Avignon Papacy and end the Western Schism of the Catholic Church, which was resolved by the election of Pope Martin V. During his long reign, the royal castle of Buda became probably the largest Gothic palace of the late Middle Ages.


title: History of Hungary

text: After the death of Sigismund in 1437, his son-in-law, Albert II of Germany, assumed the title King of Hungary. In 1437, there was an anti-feudal and anti-clerical peasant revolt in Transylvania which was strongly influenced by Hussite ideas. The first Hungarian Bible translation was completed in 1439 just before Albert's death in 1439.


title: History of Hungary

text: From a small noble family in Transylvania, John Hunyadi grew to become one of the country's most powerful lords, thanks to his outstanding capabilities as a mercenary commander. In 1446, the parliament elected him governor (1446–1453), then regent (1453–1456). He was a successful crusader against the Ottoman Turks, with one of his greatest victories the Siege of Belgrade in 1456. Hunyadi defended the city against the onslaught of the Ottoman Sultan Mehmed II. During the siege, Pope Callixtus III ordered the bells of every European church to be rung every day at noon as a call for believers to pray for the defenders of the city. However, in many countries (such as England and the Spanish kingdoms), the news of the victory arrived before the order, and the ringing of the church bells at noon was transformed into a commemoration of the victory. The popes did not withdraw the order, and Catholic (and the older Protestant) churches still ring the noon bell in the Christian world to this day.


title: History of Hungary

text: The last strong Hungarian king was Matthias Corvinus (r. 1458–90), the son of John Hunyadi. His accession represented the first time in the history of the medieval Hungarian kingdom that a member of the nobility without dynastic ancestry mounted the royal throne. Although very prominent in the governing of the kingdom of Hungary, Matthias's father John Hunyadi was never crowned king or contracted a dynastic marriage. Matthias was a true Renaissance prince: a successful military leader and administrator, an outstanding linguist, a learned astrologer, and an enlightened patron of the arts and learning. Although he regularly convened the Diet and expanded the lesser nobles' powers in the counties, he exercised absolute rule over Hungary by means of a huge secular bureaucracy.


title: History of Hungary

text: Matthias set out to build a realm that would expand to the south and northwest, while he also implemented internal reforms. The serfs considered Matthias a just ruler, because he protected them from excessive demands and other abuses by the magnates. Like his father, Matthias desired to strengthen the kingdom of Hungary to the point where it could become the foremost regional power, indeed strong enough to push back the Ottoman Empire; towards that end he deemed it necessary to conquer large parts of the Holy Roman Empire.


title: History of Hungary

text: Matthias's standing mercenary army was called the Black Army of Hungary (). It was an unusually large army for its time, and it secured a series of victories in the Austrian–Hungarian War by capturing parts of Austria (including Vienna) in 1485, as well as parts of Bohemia in the Bohemian War of 1477–88. In 1467, Mathias and his Black Army fought against Moldavia. In this case, the attempt to expand Hungarian territories was unsuccessful when Matthias lost the Battle of Baia. In 1479, however, the Hungarian army destroyed the Ottoman and Wallachian troops at the Battle of Breadfield under the leadership of general Pál Kinizsi.


title: History of Hungary

text: Matthias's library, the Bibliotheca Corviniana, was Europe's greatest collection of historical chronicles and works of philosophy and science in the 15th century, and second in size only to the Vatican Library in Rome, which mainly contained religious materials. The library, which has been destroyed in 1526 after Hungarian forces at Mohács were defeated by the Ottomans, is registered as a UNESCO Memory of the World site. Mattias died without a legal successor, a circumstance that engendered a serious political crisis in the Hungarian kingdom.


title: History of Hungary

text: Events of the 1490–1526 period in Hungarian history created conditions that would lead to a loss of independence unforeseen by contemporary observers and policy makers. Besides internal conflicts, the Hungarian state was gravely threatened by the expanding Ottoman Empire. By the early 16th century, the Ottoman Empire—directly south of Hungary—had become the second most populous political state in the world, which facilitated the raising of the largest armies of the era. However, Hungarian policy makers at the time were not as conscious of this threat as they should have been.


title: History of Hungary

text: Instead of preparing for the defence of the country against foreign powers, Hungarian magnates were much more focused on the threat to their privileges from a strong royal power. Not wanting another assertive king after the death of the childless Matthias Corvinus, the magnates arranged for the accession of King Vladislaus II of Bohemia precisely because of his notorious weakness; in fact, he was known as King Dobzse (from Czech Dobře, meaning "Good" or, loosely, "OK") for his habit of accepting with that word every paper laid before him. During his reign (1490–1516), the central power began to experience severe financial difficulties, largely because of the enlargement of feudal lands at his expense. The magnates also dismantled the administrative systems in the country that had worked so successfully for Matthias. The country's defenses declined as border guards and castle garrisons went unpaid, fortresses fell into disrepair, and initiatives to increase taxes to reinforce defenses were stifled. Hungary's international role was neutralized, its political stability shaken, and social progress was deadlocked.


title: History of Hungary

text: In 1514, the weakened and aging Vladislaus faced a major peasant rebellion led by György Dózsa. It was ruthlessly crushed by the Hungarian nobles led by János Szapolyai. The resulting degradation of order paved the way for Ottoman ambitions to acquire Hungarian territory. In 1521, the strongest Hungarian fortress in the south, Nándorfehérvár (modern Belgrade), fell to the Turks, and in 1526 the Hungarian army was crushed at the Battle of Mohács. The young King Louis II died in the battle along with General Tomori. The early appearance of Protestantism further worsened internal unity in the anarchical country.


title: History of Hungary

text: After the Ottomans achieved their first decisive victory over the Hungarian army at the Battle of Mohács, their forces conquered large parts of the kingdom of Hungary and continued their expansion until 1556. This period was characterized by political chaos. A divided Hungarian nobility elected two kings simultaneously, Szapolyai and the Austrian Ferdinand of Habsburg. Armed conflicts between the rival monarchs further weakened the country. With the Turkish conquest of Buda in 1541, Hungary was riven into three parts.


title: History of Hungary

text: The northwestern part of the old kingdom of Hungary (present-day Slovakia, western Transdanubia and Burgenland, plus western Croatia and parts of present-day northeastern Hungary) remained under Habsburg rule as the realm of King Ferdinand. Although initially independent, it would later become a part of the Habsburg monarchy under the informal name Royal Hungary. The Habsburg emperors would from then on be crowned also as kings of Hungary. The Turks were unable to conquer the northern and western parts of Hungary.


title: History of Hungary

text: The eastern part of the kingdom (Partium and Transylvania) at first became an independent principality but was gradually brought under Turkish rule as a vassal state of the Ottoman Empire. The remaining central area (most of present-day Hungary), including the capital of Buda, became a province of the Ottoman Empire. Much of the land was devastated by recurrent warfare. Most small Hungarian settlements disappeared. Rural people living in the new Ottoman provinces could survive only in larger settlements known as Khaz towns, which were owned and protected directly by the sultan. The Turks were indifferent to the Christian denominations practiced by their Hungarian subjects.


title: History of Hungary

text: For this reason, a majority of Hungarians living under Ottoman rule became Protestant (largely Calvinist), as Habsburg counter-Reformation efforts could not penetrate the Ottoman lands. Largely throughout this time, Pozsony (in German, Pressburg, today Bratislava) acted as the capital of the kingdom of Hungary (1536–1784), the town in which the Hungarian kings were crowned (1563–1830) and the seat of the Diet of Hungary (1536–1848). Nagyszombat (modern Trnava) acted in turn as the religious center beginning in 1541. The vast majority of the soldiers in service in the Ottoman fortresses in the territory of Hungary were Orthodox and Muslim Balkan Slavs, instead of ethnic Turkish people.


title: History of Hungary

text: In 1558 the Transylvanian Diet of Turda declared free practice of both the Catholic and Lutheran religions but prohibited Calvinism. In 1568, the diet extended this freedom, declaring that, "It is not allowed to anybody to intimidate anybody with captivity or expulsion for his religion". Four religions were declared as accepted ("recepta"), while Orthodox Christianity was "tolerated" (though the building of stone Orthodox churches was forbidden). When Hungary entered the Thirty Years' War of 1618–48, Royal (Habsburg) Hungary joined the Catholic side, then Transylvania joined the Protestant side.


title: History of Hungary

text: In 1686, two years after the unsuccessful Battle of Buda, a renewed European campaign was started to re-take the Hungarian capital. This time, the army of the Holy League was twice as large, at over 74,000 men, including German, Croat, Dutch, Hungarian, English, Spanish, Czech, Italian, French, Burgundian, Danish and Swedish soldiers, along with other Europeans as volunteers, artilleryman, and officers, and the Christian forces reconquered Buda in the second Battle of Buda. The second Battle of Mohács (1687) was a crushing defeat for the Turks. In the next few years, all former Hungarian lands, except areas near Timișoara (Temesvár), were taken back from the Turks. At the end of the 17th century, Transylvania also became part of Hungary again. In the Treaty of Karlowitz of 1699, these territorial changes were officially recognised, and in 1718, the entire kingdom of Hungary was removed from Ottoman rule.


title: History of Hungary

text: As a consequence of the constant warfare between Hungarians and Ottoman Turks, population growth was stunted, and the network of medieval settlements with their urbanized bourgeois inhabitants perished. The 150 years of Turkish wars fundamentally changed the ethnic composition of Hungary. As a result of demographic losses, including deportations and massacres, the number of ethnic Hungarians at the end of the Turkish period was substantially diminished.


title: History of Hungary

text: There was a series of anti-Habsburg uprisings between 1604 and 1711, rebelling against Austrian rule and restrictions on non-Catholic Christian denominations. With the exception of the last, all took place within the territories of Royal Hungary but were usually organized from Transylvania. The last uprising was led by Francis II Rákóczi, who took power as the "Ruling Prince" of Hungary after the declared dethronement of the Habsburgs in 1707 at the Diet of Ónod.


title: History of Hungary

text: Despite some successes by the anti-Habsburg Kuruc army, such as the near-capture of the Austrian Emperor Joseph I by Ádám Balogh, the rebels lost the decisive Battle of Trenčín in 1708. When Austrians defeated the Kuruc uprising in 1711, Rákóczi was in Poland. He later fled to France, then to Turkey, and died in 1735 in Tekirdağ (Rodosto). Afterward, to make further armed resistance infeasible, the Austrians demolished most of the castles on the border between the reclaimed territories occupied earlier by the Ottomans and Royal Hungary.


title: History of Hungary

text: Hungarian nationalism emerged among intellectuals influenced by the Age of Enlightenment and Romanticism. It grew rapidly, providing the foundation for the revolution of 1848–49. There was a special focus on the Magyar language, which replaced Latin as the language of the state and the schools. In the 1820s, Emperor Francis I was forced to convene the Hungarian Diet, which inaugurated a Reform Period. Nevertheless, progress was slowed by the nobles who clung to their privileges (exemption from taxes, exclusive voting rights, etc.). Therefore, the achievements were mostly of a symbolic character, such as the progress of the Magyar language.


title: History of Hungary

text: Count István Széchenyi, the nation's most prominent statesman, recognized the urgent need for modernization, and his message was taken to heart by other Hungarian political leaders. The Hungarian Parliament was reconvened in 1825 to handle financial needs. A liberal party emerged focusing on the peasantry and proclaiming an understanding of the needs of the laborers. Lajos Kossuth emerged as leader of the lower gentry in the Parliament. Habsburg monarchs, desiring an agrarian, traditional Hungary, tried to hinder the industrialization of the country. A remarkable upswing started as the nation concentrated on modernization despite Habsburg obstruction of all important liberal laws concerning civil and political rights and economic reforms. Many reformers (such as Lajos Kossuth and Mihály Táncsics) were imprisoned by the authorities.


title: History of Hungary

text: On 15 March 1848, mass demonstrations in Pest and Buda enabled Hungarian reformists to push through a list of Twelve Demands. The Hungarian Diet took advantage of the Revolutions of 1848 in the Habsburg areas to enact the April Laws, a comprehensive legislative program of dozens of civil rights reforms. Faced with revolution both at home and in Hungary, Austrian Emperor Ferdinand I at first had to accept Hungarian demands. After the Austrian uprising was suppressed, a new emperor Franz Joseph replaced his epileptic uncle Ferdinand. Joseph rejected all reforms and started to arm against Hungary. A year later, in April 1849, an independent government of Hungary was established.


title: History of Hungary

text: The new government seceded from the Austrian Empire. The House of Habsburg was dethroned in the Hungarian part of the Austrian Empire, and the first Republic of Hungary was proclaimed, with Lajos Kossuth as governor and president. The first prime minister was Lajos Batthyány. Joseph and his advisers skillfully manipulated the new nation's ethnic minorities, the Croatian, Serbian and Romanian peasantry, led by priests and officers firmly loyal to the Habsburgs, and induced them to rebel against the new government. The Hungarians were supported by the vast majority of the Slovaks, Germans, and Rusyns of the country, and almost all the Jews, as well as by a large number of Polish, Austrian and Italian volunteers.


title: History of Hungary

text: Many members of the non-Hungarian nationalities secured high positions in the Hungarian army, for example General János Damjanich, an ethnic Serb who became a Hungarian national hero through his command of the 3rd Hungarian Army Corps. Initially, the Hungarian forces ("Honvédség") managed to hold their ground. In July 1849, the Hungarian Parliament proclaimed and enacted the most progressive ethnic and minority rights in the world, but it was too late. To subdue the Hungarian revolution, Joseph had prepared his troops against Hungary and obtained help from the "Gendarme of Europe", Russian Czar Nicholas I. In June, Russian armies invaded Transylvania in concert with Austrian armies marching on Hungary from western fronts on which they had been victorious (Italy, Galicia and Bohemia).


title: History of Hungary

text: The Russian and Austrian forces overwhelmed the Hungarian army, and General Artúr Görgey surrendered in August 1849. The Austrian marshall Julius Freiherr von Haynau then became governor of Hungary for a few months and on 6 October ordered the execution of 13 leaders of the Hungarian army as well as Prime Minister Batthyány; Kossuth escaped into exile. Following the war of 1848–1849, the country sank into "passive resistance". Archduke Albrecht von Habsburg was appointed governor of the Kingdom of Hungary, and this time was remembered for Germanisation pursued with the help of Czech officers.


title: History of Hungary

text: Vienna realized that political reform was unavoidable to secure the integrity of the Habsburg Empire. Major military defeats, such as the Battle of Königgrätz in 1866, forced Emperor Joseph to accept internal reforms. To appease Hungarian separatists, the emperor made an equitable deal with Hungary, the Austro-Hungarian Compromise of 1867 negotiated by Ferenc Deák, by which the dual monarchy of Austria-Hungary came into existence. The two realms were governed separately by two parliaments from two capitals, with a common monarch and common foreign and military policies. Economically, the empire was a customs union. The first prime minister of Hungary after the compromise was Count Gyula Andrássy. The old Hungarian constitution was restored, and Franz Joseph was crowned king of Hungary.


title: History of Hungary

text: In 1868, Hungarian and Croatian assemblies concluded the Croatian–Hungarian Agreement by which Croatia was recognised as an autonomous region.


title: History of Hungary

text: The nation of Austria-Hungary was geographically the second largest country in Europe after Russia. Its territories were appraised at in 1905. After Russia and the German Empire, it was the third most populous country in Europe.


title: History of Hungary

text: Hungarian nationalists demanded education in the Magyar language, a position that united Catholics and Protestants opposed to instruction in Latin as desired by Catholic bishops. In the diet of 1832–36, the conflict between Catholic laymen and clergy sharpened considerably, and a mixed commission was established. It offered the Protestants certain limited concessions. The basic issue of this religious and educational struggle was how to promote Magyar language and Magyar nationalism and achieve more independence from German Austria.


title: History of Hungary

text: The land-owning nobility controlled the villages and monopolized political roles. In Parliament, the magnates held life memberships in the upper house, but the gentry dominated the lower house and, after 1830, parliamentary life. The tension between "crown" (the German-speaking Habsburgs in Vienna) and "country" remained a constant political fixture as the Compromise of 1867 enabled the Magyar nobility to run the country, but left the emperor with control over foreign and military policies. However, after Andrássy served as prime minister, he became foreign minister of Austria-Hungary (1871–1879) and set foreign policies with an eye to Hungarian interests. Andrássy was a conservative; his foreign policies looked to expanding the empire into southeast Europe, preferably with British and German support, and without alienating Turkey. He saw Russia as the main adversary, because of its own expansionist policies toward Slavic and Orthodox areas. He distrusted Slavic nationalist movements as a threat to his multi-ethnic empire. Meanwhile, conflicts between magnates and gentry appeared regarding protection against cheap food imports (in the 1870s), the Church-state problem (in the 1890s), and the "constitutional crisis" (in the 1900s). The gentry gradually lost their power locally and rebuilt their political base more on office-holding rather than land ownership. They depended more on the state apparatus and were reluctant to challenge it.


title: History of Hungary

text: The era witnessed significant economic development in the rural areas. The formerly backwards Hungarian economy became relatively modern and industrialized by the turn of the 20th century, although agriculture remained dominant in the GDP until 1880. In 1873, the old capital Buda and Óbuda (ancient Buda) were officially merged with the third city, Pest, thus creating the new metropolis of Budapest. The dynamic Pest grew into the country's administrative, political, economic, trade and cultural hub.


title: History of Hungary

text: Technological advancement accelerated industrialization and urbanization. The GDP per capita grew roughly 1.45% per year from 1870 to 1913. That level of growth compared very favorably to that of other European nations such as Britain (1.00%), France (1.06%), and Germany (1.51%). The leading industries in this economic expansion were electricity and electro-technology, telecommunications, and transport (especially locomotive, tram and ship construction). The key symbols of industrial progress were the Ganz concern and Tungsram Works. Many of the state institutions and modern administrative systems of Hungary were established during this period.


title: History of Hungary

text: The census of the Hungarian state in 1910 (excluding Croatia), recorded the following population distribution: Hungarian 54.5%, Romanian 16.1%, Slovak 10.7%, and German 10.4%. The religious denomination with the greatest number of adherents was Roman Catholicism (49.3%), followed by the Calvinism (14.3%), Greek Orthodoxy (12.8%), Greek Catholicism (11.0%), Lutheranism (7.1%), and Judaism (5.0%)


title: History of Hungary

text: After the assassination of the Austrian Archduke Franz Ferdinand in Sarajevo on 28 June 1914, a series of crises escalated quickly. A general war began on 28 July with a declaration of war on Serbia by Austria-Hungary. Austria-Hungary drafted 9 million soldiers in World War I, of which 4 million were from the kingdom of Hungary. Austria-Hungary fought on the side of Germany, Bulgaria and Ottoman Empire—the so-called Central Powers. They occupied Serbia, and Romania declared war. The Central Powers then conquered southern Romania and the Romanian capital of Bucharest. In November 1916, Emperor Franz Joseph died; the new monarch, Emperor Charles I of Austria ("IV. Károly"), sympathized with the pacifists in his realm.


title: History of Hungary

text: In the east, the Central Powers repelled attacks from the Russian Empire. The Eastern Front of the so-called Entente Powers allied with Russia completely collapsed. Austria-Hungary withdrew from the defeated countries. On the Italian front, the Austro-Hungarian army could not make more successful progress against Italy after January 1918. Despite successes on the Eastern Front, Germany suffered stalemate and eventual defeat on the more determinant Western Front.


title: History of Hungary

text: By 1918, the economic situation had deteriorated alarmingly in Austria-Hungary; strikes in factories were organized by leftist and pacifist movements, and uprisings in the army had become commonplace. In the capital cities of Vienna and Budapest, the Austrian and the Hungarian leftist liberal movements and their leaders supported the separatism of ethnic minorities. Austria-Hungary signed the Armistice of Villa Giusti in Padua on 3 November 1918. In October 1918, the personal union between Austria and Hungary was dissolved.


title: History of Hungary

text: In the aftermath of World War I, while ally Germany was defeated in 1918 on the Western Front, the Austro-Hungarian monarchy politically collapsed. Former Prime Minister István Tisza was murdered in Budapest during the Aster Revolution of October 1918. On 31 October 1918, the success of this revolution brought the leftist liberal Count Mihály Károlyi to power as prime minister. Károlyi was a devotee of the Entente powers from the beginning of the war. On 13 November 1918, Charles I surrendered his powers as king of Hungary, however, he did not abdicate, a technicality that made a return to the throne possible.


title: History of Hungary

text: French Entente troops landed in Greece to re-arm the defeated countries of Romania and Serbia and provide military assistance to the newly formed country of Czechoslovakia. Despite a general armistice agreement, the Balkan French army organized new campaigns against Hungary with the help of the Czechoslovak, Romanian and Serbian governments.


title: History of Hungary

text: The First Hungarian republic was proclaimed on 16 November 1918 with Károlyi named as president. Károlyi tried to build the republic as the "eastern Switzerland" and persuade non-Hungarian minorities (in particular, Slovaks, Romanians and Ruthenians) to stay loyal to the country, offering them autonomy. However these efforts came too late. In response to Woodrow Wilson's conception of pacifism, Károlyi ordered the full disarmament of the Hungarian army, thus the republic remained without a national defence at a time of particular vulnerability. The emerging surrounding states were not hesitant to arm themselves and occupy large parts of the country with the help of the Entente, while there was no agreement yet about their borders.


title: History of Hungary

text: On 5 November 1918, the armed forces of the provisional State of Slovenes, Croats and Serbs, with French support, attacked the southern parts of Kingdom of Hungary. On 8 November, the armed forces of the Czechoslovak Republic that was proclaimed on 28 October, attacked northern parts of Kingdom of Hungary. The Treaty of Bucharest that was signed in May 1918 was denounced in October 1918 by the Romanian government, which then re-entered the war on the Allied side and advanced to the Maros (Mureș) river in Transylvania.


title: History of Hungary

text: A separatist movement inspired by Wilson's Fourteen Points proclaimed the unification of Transylvania with Romania. In November the Romanian National Central Council representing all Romanians in Transylvania, notified the Budapest government that it would take control of 23 Transylvanian counties (and parts of 3 others) and requested a Hungarian response by 2 November. The Hungarian government (after negotiations with the council) rejected the proposal, claiming that it failed to secure the rights of the ethnic Hungarian population and the German minority.


title: History of Hungary

text: On 2 December, the Romanian army started to attack the eastern (Transylvanian) parts of Kingdom of Hungary. Despite the march of foreign armed forces, the Károlyi government had made all spontaneous armed associations illegal and introduced proposals to maintain the integrity of the territory of the former kingdom, but he refused to reorganize the Hungarian armed forces. These measures failed to stem popular discontent, especially when the Entente powers began awarding pieces of Hungary's traditional territories to Romania and the newly formed states Yugoslavia and Czechoslovakia, giving priority to ethno-linguistic criteria over historical ones. French and Serbian forces occupied the southern parts of the former monarchy.


title: History of Hungary

text: By February 1919, the new pacifist Hungarian government had lost all popular support in view of its failures on both domestic and military fronts. On 21 March 1919, after the Entente military representative demanded more territorial concessions from Hungary, Károlyi signed all the concessions presented to him and resigned.


title: History of Hungary

text: The Communist Party of Hungary, led by Béla Kun, allied itself with the Hungarian Social Democratic Party, came to power, and proclaimed the Hungarian Soviet Republic. Social Democrat Sándor Garbai was the official head of government, but the Soviet Republic was dominated de facto by Béla Kun, who was in charge of foreign affairs. The communists—"The Reds"—came to power largely thanks to its organized fighting force (no other major political entity had one of its own), and they promised that Hungary would defend its territory without conscription, possibly with the help of the Soviet Red Army.


title: History of Hungary

text: The Red Army of Hungary was a small voluntary army of 53,000 men, and most of its soldiers were armed factory workers from Budapest. Initially, Kun's regime achieved some military successes: under the command of its genius strategist Colonel Aurél Stromfeld, the Hungarian Red Army ousted Czechoslovak troops from the north and planned to march against the Romanian army in the east. In terms of domestic policy, the communist government nationalized industrial and commercial enterprises, socialized housing, transport, banking, medicine, cultural institutions, and all landholdings of more than 400,000 square meters.


title: History of Hungary

text: The support of the communists proved to be short-lived in Budapest, however, and they had never been popular in country towns and countryside. In the aftermath of a coup attempt, the government took a series of actions referred to as the Red Terror, murdering several hundred people (mostly scientists and intellectuals). The Soviet Red Army was never able to aid the Hungarian republic. Despite the great military successes against the Czechoslovakian army, the communist leaders gave back all recaptured lands. That attitude demoralized the voluntary army; the Hungarian Red Army was dissolved before it could successfully complete its campaigns. In the face of domestic backlash and an advancing Romanian force in the Hungarian–Romanian War of 1919, Béla Kun and most of his comrades fled to Austria, and Budapest was occupied on 6 August. Kun and his followers took along numerous art treasures and the gold stocks of the national bank. All these events, and in particular the final military defeat, led to a deep feeling of dislike among the general population against the Soviet Union (which did not offer military assistance) and the Hungarian Jews (since most members of Kun's government were Jewish, making it easy to blame the Jews for the government's crimes).