There are several ways to implement multi-threaded synchronization, what is it?

Source: Internet
Author: User

There are several ways to implement multi-threaded synchronization, what is it?


There are several ways to implement multithreading, what is it? How are there several implementations of synchronization?


There are two ways to implement multithreading, that is, inheriting the thread class and implementing Runnable interface synchronization in two ways, namely synchronized,wait and notify


About the path to cookies and the access to cookies?


Cookie c1=new Cookie "CNAME", "C1");


C1.setpath "/myapp");


C1.setMaxAgeInteger.MAX_VALUE);


RESPONSE.ADDCOOKIEC1);


Cookie c2=new Cookie "CNAME", "C2");


C2.setpath "/myapp/servlet");


C2.setMaxAgeInteger.MAX_VALUE);


RESPONSE.ADDCOOKIEC2);


The above code indicates that a cookie with 2 duplicate names has been written to the client, but the path property is not the same.


Which Cookie will the browser bring to the server?


A: This must be determined based on the path to the server resource that the client accesses.


If the path of a resource accessed by a user is/myapp/servlet/someservlet,


Then these 2 cookie browsers will be brought to the server, if the user accesses the path of the resource is/myapp/1jsp,


Then the browser will only bring a 1th cookie over.


There are several ways to implement multi-threaded synchronization, what is it?

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.