Home>Articles

Synchronization

The final part of concurrent programming, synchronization, involves goroutines -race3 flag, sync.Mutex4, sync.RWMutex.5, and sync.Once.

This chapter is from the book

This chapter is from the book

In Chapter 11, we explained how to use channels for passing data between goroutines. Then in Chapter 12, we discussed how to use thecontext1package to manage the cancellation of goroutines. In this chapter, we cover the final part of concurrent programming: synchronization.

We show you how to wait for a number of goroutines to finish. We explainrace conditions,2how to find them using Go’s-race3flag, and how to fix them withsync.Mutex4andsync.RWMutex5

Finally, we discuss how to usesync.Onceto ensure a function is only executed one time.

Waiting for Goroutines with a WaitGroup

Often, you might want to wait for a number of goroutines to finish before you continue your program. For example, you might want to spawn a number of goroutines to create a number of thumbnails of different sizes and wait for them all to complete before you continue.

The Problem

Consider Listing 13.1. We launch5new goroutines, each of which creates a thumbnail of a different size. We then wait for all of them to complete.

Listing 13.1 Launching Multiple Goroutines to Complete One Task
funcTest_ThumbnailGenerator(t*testingT) {tParallel()// image that we need thumbnails forconstimage="foo.png"// start 5 goroutines to generate thumbnailsfori:=0;i<5;i++ {// start a new goroutine for each thumbnailgogenerateThumbnail(image,i+1)}fmtPrintln("Waiting for thumbnails to be generated") }

ThegenerateThumbnailfunction, Listing 13.2, generates a thumbnail of the specified size. In this example, we sleep one millisecond per “size” of thumbnail to simulate the time it takes to generate the thumbnail. For example, if we callgenerateThumbnail("foo.png", 200), we sleep 200 milliseconds before returning.

Listing 13.2 A Test Exiting before All Goroutines Have Finished
funcgenerateThumbnail(imagestring,sizeint) {// thumbnail to be generatedthumb:=fmtSprintf("%s@%dx.png",image,size)fmtPrintln("Generating thumbnail:",thumb)// wait for the thumbnail to be readytimeSleep(timeMillisecond*timeDuration(size))fmtPrintln("Finished generating thumbnail:",thumb) }

$ go test -v === RUN Test_ThumbnailGenerator === PAUSE Test_ThumbnailGenerator === CONT Test_ThumbnailGenerator Waiting for thumbnails to be generated --- PASS: Test_ThumbnailGenerator (0.00s) PASS ok demo 0.408s

Go Version: go1.19

As you can see from the test output in Listing 13.2, the test exits before the thumbnails are generated.

Our tests exit prematurely because we have not provided any mechanics to ensure that we wait for all of the thumbnail goroutines to finish before we continue.

Using a WaitGroup

To help us solve this problem, we can use async.WaitGroup,6Listing 13.3, to track how many goroutines are still running and notify us when they have all finished.

Listing 13.3 Thesync.WaitGroupType
$ go doc -short sync.WaitGroup type WaitGroup struct { // Has unexported fields. } A WaitGroup waits for a collection of goroutines to finish. The mainarrow.jpggoroutine calls Add to set the number of goroutines to wait for. Thenarrow.jpgeach of the goroutines runs and calls Done when finished. At the samearrow.jpg时间,等待可以用来阻止,直到所有goroutines have finished. A WaitGroup must not be copied after first use. func (wg *WaitGroup) Add(delta int) func (wg *WaitGroup) Done() func (wg *WaitGroup) Wait()

Go Version: go1.19

The principle is simple: We create async.WaitGroupand use thesync.WaitGroup.Add7method to add to thesync.WaitGroupfor each goroutine we want to wait for. When we want to wait for all of the goroutines to finish, we call thesync.WaitGroup.Wait8method. When a goroutine finishes, it calls thesync.WaitGroup.Done9method to indicate that the goroutine is finished.

TheWaitMethod

As the name suggests, async.WaitGroupis about waiting for a group of tasks, or goroutines, to finish. To do this, we need a way of blocking until all of the tasks have finished. Thesync.WaitGroup.Waitmethod in Listing 13.4 does exactly that.

Thesync.WaitGroup.Waitmethod blocks until its internal counter is zero. When the counter is zero, it means that all of the tasks have finished, and we can unblock and continue.

Listing 13.4 Thesync.WaitGroup.WaitMethod
$ go doc sync.WaitGroup.Wait package sync // import "sync" func (wg *WaitGroup) Wait() Wait blocks until the WaitGroup counter is zero.

Go Version: go1.19

TheAddMethod

For async.WaitGroupto know how many goroutines it needs to wait for, we need to add them to thesync.WaitGroupusing thesync.WaitGroup.Addmethod, Listing 13.5.

Listing 13.5 Thesync.WaitGroup.AddMethod
$ go doc sync.WaitGroup.Add package sync // import "sync" func (wg *WaitGroup) Add(delta int) Add adds delta, which may be negative, to the WaitGroup counter.arrow.jpgIf the counter becomes zero, all goroutines blocked on Wait are released.arrow.jpgIf the counter goes negative, Add panics. Note that calls with a positive delta that occur when the counter isarrow.jpgzero must happen before a Wait. Calls with a negative delta, or callsarrow.jpgwith a positive delta that start when the counter is greater than zero,arrow.jpgmay happen at any time. Typically this means the calls to Add shouldarrow.jpgexecute before the statement creating the goroutine or other event to bearrow.jpgwaited for. If a WaitGroup is reused to wait for several independentarrow.jpgsets of events, new Add calls must happen after all previous Wait callsarrow.jpghave returned. See the WaitGroup example.

Go Version: go1.19

Thesync.WaitGroup.Addmethod takes a single integer argument, which is the number of goroutines to wait for. There are, however, some caveats to be aware of.

Adding a Positive Number

Thesync.WaitGroup.Addmethod accepts anintargument, which is the number of goroutines to wait for. If we pass a positive number, thesync.WaitGroup.Addmethod adds that number of goroutines to thesync.WaitGroup

As you can see from the test output in Listing 13.6, thesync.WaitGroup.Waitmethod blocks until the internal counter of thesync.WaitGroupreaches zero.

Listing 13.6 Adding a Positive Number of Goroutines
funcTest_WaitGroup_Add_Positive(t*testingT) {tParallel()varcompletedbool// create a new waitgroup (count: 0)varwg syncWaitGroup// add one to the waitgroup (count: 1)wgAdd(1)// launch a goroutine to call the Done() methodgo func(wg*syncWaitGroup) {// sleep for a bittimeSleep(timeMillisecond*10)fmtPrintln("done with waitgroup")completed=true// call the Done() method to decrement // the waitgroup counter (count: 0)wgDone() }(&wg)fmtPrintln("waiting for waitgroup to unblock")// wait for the waitgroup to unblock (count: 1)wgWait()// (count: 0)fmtPrintln("waitgroup is unblocked")if!completed{tFatal("waitgroup is not completed") } }

$ go test -v -run Positive === RUN Test_WaitGroup_Add_Positive === PAUSE Test_WaitGroup_Add_Positive === CONT Test_WaitGroup_Add_Positive waiting for waitgroup to unblock done with waitgroup waitgroup is unblocked --- PASS: Test_WaitGroup_Add_Positive (0.01s) PASS ok demo 0.351s

Go Version: go1.19

Adding a Zero Number

It is legal to call thesync.WaitGroup.Addmethod with a zero number,0, Listing 13.7. In this case, thesync.WaitGroup.Addmethod does nothing. The call becomes a no-op.

Listing 13.7 Adding a Zero Number of Goroutines
funcTest_WaitGroup_Add_Zero(t*testingT) {tParallel()// create a new waitgroup (count: 0)varwg syncWaitGroup// add 0 to the waitgroup (count: 0)wgAdd(0)// (count: 0)fmtPrintln("waiting for waitgroup to unblock")// wait for the waitgroup to unblock (count: 0) // will not block since the counter is already 0wgWait()// (count: 0)fmtPrintln("waitgroup is unblocked") }

$ go test -v -run Zero === RUN Test_WaitGroup_Add_Zero === PAUSE Test_WaitGroup_Add_Zero === CONT Test_WaitGroup_Add_Zero waiting for waitgroup to unblock waitgroup is unblocked --- PASS: Test_WaitGroup_Add_Zero (0.00s) PASS ok demo 0.166s

Go Version: go1.19

As you can see from the test output in Listing 13.7, thesync.WaitGroup.Waitmethod unblocked immediately because its internal counter is already zero.

Adding a Negative Number

When calling thesync.WaitGroup.Addmethod with a negative number, thesync.WaitGroup.Addmethod panics.

As you can see from the test output in Listing 13.8, thesync.WaitGroup.Waitmethod was never reached because thesync.WaitGroup.Addmethod panicked when we tried to add a negative number of goroutines.

Listing 13.8 Adding a Negative Number of Goroutines
funcTest_WaitGroup_Add_Negative(t*testingT) {tParallel()// create a new waitgroup (count: 0)varwg syncWaitGroup// use an anonymous function to trap the panic // so we can properly mark the test as a failurefunc() {// defer a function to catch the panicdefer func() {// recover the panicifr:=recover();r!=nil{// mark the test as a failuretFatal(r) } }()// add a negative number to the waitgroup // this will panic since the counter cannot be negativewgAdd(-1)fmtPrintln("waiting for waitgroup to unblock")// this will never be reachedwgWait()fmtPrintln("waitgroup is unblocked") }()}

$ go test -v -run Negative === RUN Test_WaitGroup_Add_Negative === PAUSE Test_WaitGroup_Add_Negative === CONT Test_WaitGroup_Add_Negative add_test.go:92: sync: negative WaitGroup counter --- FAIL: Test_WaitGroup_Add_Negative (0.00s) FAIL exit status 1 FAIL demo 0.753s

Go Version: go1.19

The Done Method

Once we increase that counter by calling thesync.WaitGroup.Addmethod, thesync.WaitGroup.Waitmethod blocks until we decrement the counter as we finish with each goroutine.

For each item we add to thesync.WaitGroupwith thesync.WaitGroup.Addmethod, we need to call thesync.WaitGroup.Donemethod, Listing 13.9, to indicate that the goroutine is finished.

Listing 13.9 Thesync.WaitGroup.Donemethod
$ go doc sync.WaitGroup.Done package sync // import "sync" func (wg *WaitGroup) Done() Done decrements the WaitGroup counter by one.

Go Version: go1.19

Consider Listing 13.10, which createsNgoroutines and addsNto thesync.WaitGroupusing thesync.WaitGroup.Addmethod. Each goroutine calls thesync.WaitGroup.Donemethod after it finishes. We then use thesync.WaitGroup.Waitmethod to wait for all of the goroutines to finish.

Listing 13.10 Testing thesync.WaitGroup.DoneMethod
funcTest_WaitGroup_Done(t*testingT) {tParallel()constN=5// create a new waitgroup (count: 0)varwg syncWaitGroup// add 5 to the waitgroup (count: 5)wgAdd(N)fori:=0;i<N;i++ {// launch a goroutine that will call the // waitgroup's Done method when it finishesgo func(iint) {// sleep brieflytimeSleep(timeMillisecond*timeDuration(i))fmtPrintln("decrementing waiting by 1")// call the waitgroup's Done method // (count: count - 1)wgDone()}(i+1) }fmtPrintln("waiting for waitgroup to unblock")wgWait()fmtPrintln("waitgroup is unblocked") }

美元去测试- v超时1 s = = = Test_WaitGroup_Do运行ne === PAUSE Test_WaitGroup_Done === CONT Test_WaitGroup_Done waiting for waitgroup to unblock decremeting waiting by 1 decremeting waiting by 1 decremeting waiting by 1 decremeting waiting by 1 decremeting waiting by 1 waitgroup is unblocked --- PASS: Test_WaitGroup_Done (0.01s) PASS ok demo 0.384s

Go Version: go1.19

As we can see from the test output, Listing 13.10, thesync.WaitGroup.Waitmethod unblocked after all of the goroutines finished.

Improper Usage

If you don’t callsync.WaitGroup.Doneexactly once for each item you add withsync.WaitGroup.Add,sync.WaitGroup.Waitmethod will block forever, which causes a deadlock and crashes your program, as shown in Listing 13.11.

Listing 13.11 Decrementing async.WaitGroupwith thesync.WaitGroup.DoneMethod
funcTest_WaitGroup_Done(t*testingT) {tParallel()constN=5// create a new waitgroup (count: 0)varwg syncWaitGroup// add 5 to the waitgroup (count: 5)wgAdd(N)fori:=0;i<N;i++ {// launch a goroutine that will call the // waitgroup's Done method when it finishesgo func(iint) {// sleep brieflytimeSleep(timeMillisecond*timeDuration(i))fmtPrintln("finished")// exiting with calling the Done method // (count: count)}(i+1) }fmtPrintln("waiting for waitgroup to unblock")// this will never unblock // because the goroutines never call Done // and the application will deadlock and panicwgWait()fmtPrintln("waitgroup is unblocked")}

美元去测试- v超时1 s = = = Test_WaitGroup_Do运行ne === PAUSE Test_WaitGroup_Done === CONT Test_WaitGroup_Done waiting for waitgroup to unblock finished finished finished finished finished panic: test timed out after 1s goroutine 19 [running]: testing.(*M).startAlarm.func1() /usr/local/go/src/testing/testing.go:2029 +0x8c created by time.goFunc /usr/local/go/src/time/sleep.go:176 +0x3c goroutine 1 [chan receive]: testing.tRunner.func1() /usr/local/go/src/testing/testing.go:1405 +0x45c testing.tRunner(0x140001361a0, 0x1400010fcb8) /usr/local/go/src/testing/testing.go:1445 +0x14c testing.runTests(0x1400001e280?, {0x101045ea0, 0x1, 0x1},arrow.jpg{0x6e00000000000000?, 0x100e71218?, 0x10104e640?}) /usr/local/go/src/testing/testing.go:1837 +0x3f0 testing.(*M).Run(0x1400001e280) /usr/local/go/src/testing/testing.go:1719 +0x500 main.main() _testmain.go:47 +0x1d0 goroutine 4 [semacquire]: sync.runtime_Semacquire(0x0?) /usr/local/go/src/runtime/sema.go:56 +0x2c sync.(*WaitGroup).Wait(0x14000012140) /usr/local/go/src/sync/waitgroup.go:136 +0x88 demo.Test_WaitGroup_Done(0x0?) ./done_test.go:43 0xd0 testing.tRunner(0x14000136340, 0x100fa1580) /usr/local/go/src/testing/testing.go:1439 +0x110 created by testing.(*T).Run /usr/local/go/src/testing/testing.go:1486 +0x300 exit status 2 FAIL demo 1.225s

Go Version: go1.19

If you callsync.WaitGroup.Donemore than the number of items you added withsync.WaitGroup.Add,sync.WaitGroup.Donemethod panics, Listing 13.12. The result is the same as if you calledsync.WaitGroup.Addwith a negative number.

Listing 13.12 Panicking from Decrementingsync.WaitGroupToo Many Times
funcTest_WaitGroup_Done(t*testingT) {tParallel()func() {// defer a function to catch the panicdefer func() {// recover the panicifr:=recover();r!=nil{// mark the test as a failuretFatal(r) } }()// create a new waitgroup (count: 0)varwg syncWaitGroup// call done creating a negative // waitgroup counterwgDone()// this line is never reachedfmtPrintln("waitgroup is unblocked") }()}

美元去测试- v超时1 s = = = Test_WaitGroup_Do运行ne === PAUSE Test_WaitGroup_Done === CONT Test_WaitGroup_Done done_test.go:20: sync: negative WaitGroup counter --- FAIL: Test_WaitGroup_Done (0.00s) FAIL exit status 1 FAIL demo 0.416s

Go Version: go1.19

Wrapping Up Wait Groups

Using async.WaitGroupis a great way to manage the number of goroutines or any other number of tests that need to finish before your program can continue.

As you can see, we can effectively use async.WaitGroupto manage the thumbnail generator goroutines from our initial example.

In Listing 13.13, we create a newsync.WaitGroup。Then, in theforloop, we use thesync.WaitGroup.Addmethod to add1to thesync.WaitGroup。We then pass a pointer to thegenerateThumbnailfunction tosync.WaitGroup。A pointer is needed because thegenerateThumbnailfunction needs to be able to modify thesync.WaitGroupby calling thesync.WaitGroup.Donemethod.

Finally, we call thesync.WaitGroup.Waitmethod to wait for all of the goroutines to finish.

Listing 13.13 Using async.WaitGroupto Manage the Thumbnail Generator Goroutines
funcTest_ThumbnailGenerator(t*testingT) {tParallel()// image that we need thumbnails forconstimage="foo.png"varwg syncWaitGroup// start 5 goroutines to generate thumbnailsfori:=0;i<5;i++ {wgAdd(1)// start a new goroutine for each thumbnailgogenerateThumbnail(&wg,image,i+1)}fmtPrintln("Waiting for thumbnails to be generated")// wait for all goroutines to finishwgWait()fmtPrintln("Finished generate all thumbnails") }

ThegenerateThumbnailfunction now receives a pointer to thesync.WaitGroupand defers a call to thesync.WaitGroup.Donemethod to indicate that the goroutine is finished when the function exits.

Finally, as you can see from our test output in Listing 13.14, the application now finishes successfully.

Listing 13.14 Generating Thumbnails Using async.WaitGroup
funcgenerateThumbnail(wg*syncWaitGroup,imagestring,sizeint) {deferwgDone()// thumbnail to be generatedthumb:=fmtSprintf("%s@%dx.png",image,size)fmtPrintln("Generating thumbnail:",thumb)// wait for the thumbnail to be readytimeSleep(timeMillisecond*timeDuration(size))fmtPrintln("Finished generating thumbnail:",thumb) }

$ go test -v === RUN Test_ThumbnailGenerator === PAUSE Test_ThumbnailGenerator === CONT Test_ThumbnailGenerator Waiting for thumbnails to be generated Generating thumbnail: foo.png@5x.png Generating thumbnail: foo.png@3x.png Generating thumbnail: foo.png@4x.png Generating thumbnail: foo.png@2x.png Generating thumbnail: foo.png@1x.png Finished generating thumbnail: foo.png@1x.png Finished generating thumbnail: foo.png@2x.png Finished generating thumbnail: foo.png@3x.png Finished generating thumbnail: foo.png@4x.png Finished generating thumbnail: foo.png@5x.png Finished generate all thumbnails --- PASS: Test_ThumbnailGenerator (0.01s) PASS ok demo 0.310s

Go Version: go1.19

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simplyemailinformation@informit.com

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through ourContact Us form

Other Collection and Use of Information


Application and System Logs

皮尔森自动收集日志数据来帮助sure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on theAccount page。如果一个用户不再期望我们的服务和德西res to delete his or her account, please contact us atcustomer-service@informit.comand we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive:www.e-skidka.com/u.aspx

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information toNevadaDesignatedRequest@pearson.com

Supplemental Privacy Statement for California Residents


California residents should read ourSupplemental privacy statement for California residentsin conjunction with this Privacy Notice. TheSupplemental privacy statement for California residentsexplains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Pleasecontact usabout this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020