We can work on Global variable

Have a global variable int i and set it to 0 initially.

The readers should read the variable value and print the current value of the variable. Each reader should print the variables twice. The writers should write their ids in the variable. The writer should write in one go and then verify that the correct Id is written into the variable.

Readers and writers do not run in infinite loop, but reader reads twice while writer writes and then again verifies.

The reader yields after one read and then finishes after the second read.

On the first read the reader prints:
Printf(“n This is the %d th reader reading value i = %d for the first time n”, readerID, i );
On the second read the reader prints:
Printf(“n This is the %d th reader reading value i = %d for the second time n”, readerID, i );
The writer yields after the first write and then exits after the verification step.

On the first write the writer prints:
On the verification loop the writer should print:
Printf(“n This is the %d th writer verifying value i = %d n”, writerID, i );

Sample Solution

Demographic segmenting relates to a division through variables like age, income, religion, etc. Psychographic segmenting is based on lifestyle and personality, and Behavioral segmenting concerns divisions through occasions, loyalty status, etc. As mentioned before, Vans specializes in producing outdoor, extreme sports such as skateboarding, surfing and snowboarding shoes and apparel. These products are mainly used by athletic people who play extreme sports like these and hence, Vans targets a younger, sporty male demographic. Vans has also developed into manufacturing other product lines for women and children. Apart from the extreme sports apparel, the “Old Skool” line has also been very popular, due to its affordability and its fresh style, and has started a new trend in 10-24 year old target consumers, making Vans an essential street fashion brand. This can be assimilated into demographic and psychographic segmenting. Demographic segmenting as Vans produces products that are designed to meet the tastes and sensibilities of teens and young adults. Furthermore, because the shoes are premium quality, to maintain this, the costs rise thereby increasing the price of the products and hence Vans mainly attracts upper class and upper-middle class people. For example, the prices of different Vans shoes ranges from around €60 to about €420. It can also be said that Vans uses psychographic segmenting because the use of accessories for extreme sports depends on the lifestyle of the people. Extreme sports like surfing and snowboarding are not performed by everybody and conseq>

Is this question part of your assignment?

Place order