In the interface program, often need some data classes, interface elements through the binding and other ways to display the data, however, because the UI thread is not thread-safe, it is generally necessary to invoke the interface control via Invoke. For Data-bound bindinglist, however, The Listchang event cannot be responded to, resulting in controls such as the backend grid not updating Data. Waste a gre
wait for it to become a set state, and during the wait, the thread that called Waitfor is in a suspended state. In addition WAITFOR has a parameter for the timeout setting, if this parameter is 0, do not wait, immediately return to the status of the event, if it is infinite wireless wait for this, until the set state occurs, if a finite number, wait for the corresponding number of milliseconds to return the status of the eventwhen the event transitio
The members of a class are divided into two classes, static members (static member), and instance members (instance member). A static member belongs to a class and an instance member is an instance of an object, that is, a class.A brief discussion of whether static fields and static methods are used in a class is a thread-safe issue.We are aware that the call to static field and static method is called through the class. Static methods do not operate
Unhandled exception of type "System.InvalidOperationException" occurs in System.Windows.Forms.dllAdditional Information: Invalid inter-thread operation: access it from a thread that is not creating the control "TXTPORTNAME02".Workaround:1 adding in Construction methodsCheckforillegalcrossthreadcalls = false;2 Method Two InvokeTxtportname02.invoke (new actionSystem.InvalidOperationException: "The Inter-
Status of Threads: New, Runnable, Blocked, waiting, Timed waiting, Terminated1. RUNNABLE, corresponding to the "Ready" and "running" states, that is, in the ready and running state of the thread in the Java.lang.Thread is displayed as "RUNNABLE"2. BLOCKED, corresponding to the "blocking" state, this thread needs to obtain a lock to continue execution, and this lock is currently held by other threads, so ent
1. Create a task first PackageCom.currentPro.task;Importjava.util.concurrent.Callable; Public classMuniustaskImplementsCallable{ PrivateInteger number; PublicMuniustask (Integer number) { This. Number =Number ; } @Override PublicInteger Call ()throwsException {intresult; Result= Number-1; returnresult; }}2. Create Taskexecutor Public class muniustaskexecutor { protected executorservice executors; Initializes the thread pool public mun
New Thread (new Runnable () {@Overridepublic void Run () {//spring cannot handle the Thread's transaction, the declarative transaction is invalid Defaulttransactiondefinition def = New Defaulttransactiondefinition ();d ef.setpropagationbehavior (transactiondefinition.propagation_required); Platformtransactionmanager Txmanager = Contextloader.getcurrentwebapplicationcontext (). GetBean ( Platformtransactionmanager.class);Transactionstatus status = Txma
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.