


machan thread ekak kiyanne background eke run wena process ekak. itin uba thread ekak start kalata passe app ekak nikan tiyanne nane. becoz thread eka run wenakan ube app eke wena process wenawa. so e wena anik process ube app eke gui eke controls (textbox,combobox etc.) ekka sambanda wenawa...
so machan bari welawath e wage time ekakata e control ekaka value ekak thread ekak athule idala access or use karnna hadanawanam ethanadi conflict ekak wenawa..
anna e nisa practically thread ekakin GUI eka access karanna bari...
![]()
ඇයි බන් c# වල thread එකක් ඉදන් GUI items access කරන්න බැරි
java wala kisi aulak nane ban
machan java wala swing thiyenne . eaka unge windowing took kit ekak. namuthjava wala kisi aulak nane ban
thread ekakin GUI eke tiyena textbox eke text ekak change karanna puluwanda?
machan thread ekak kiyanne background eke run wena process ekak.
![]()

thread ekakin GUI eke tiyena textbox eke text ekak change karanna puluwanda?
වැරදියි. thread වර්ග 2ක් තියෙනවා foreground thread, background thread. මේ දෙකම වෙනස්![]()




එහෙම පුලුවන් ඒකට cross thread access කරන්න BeginInvoke use කරන්න ඕනේ. .NET වල GUI elements Run වෙන්නේ එක thread එකක. එතකොට වෙනම thread එකක් හදලා ඒකේ codes දාලා ඒක run කරොත් ඒ thread එක run වෙන්නේ වෙනමම thread එකක එතකොට cross thread access වෙන්න බෑ BeginInvok නැතුව . cross thread access වෙන්න ක්රම දෙකක් තියෙනවා එකක් synchronously අනික asynchronously.
