Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question

Given two character strings s1 and s2. Using C and pthread to write down a parallel program to find out number of substrings, in string s1, that are exactly the same as string s2. The strings are finished with ‘'.

For instance, suppose number_substring(s1, s2) implements function, then number_substring ("abcdab", "ab") = 2, number_substring("aaa", "a")= 3, number_substring("abac", "bc") = 0. Assume size of s1 and s2 are n1 and n2, respectively, and p threads are used, we suppose that n1 mod p = 0, and n2 < n1/p. Strings s1 and s2 are stored in a file named "strings.txt". String s1 is evenly partitioned among p threads to concurrently search for matching with string s2. After a thread finishes its work and obtains number of local matching, this local number is additional into a global variable showing total number of matched substrings in string s1. At last this total number is printed out. The format of strings.txt is like this (the first string is s1 and the second one is s2):

s1: Hello we are doing pthread testing with a string.
s2:in

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9132864

Have any Question?


Related Questions in Computer Engineering

The business model for jpmorgan chase was change in 2008

The business model for JPMorgan Chase was change in 2008. Could the upside of the strategy have been achieved without exposing JPMorgan Chase the bank?

Small business e-commerce portalscheck out small business

Small Business e-Commerce Portals Check out Small Business Center and the other e-commerce portals mentioned. Then answer the questions. Note: Small Business Center and Entrabase.com are interesting sites that offer a wi ...

A different ethanol processing facility costs 800000 to

A different ethanol processing facility costs $800,000 to construct but will instead last forever. Every year (starting the year after  construction), it produces 10,000 barrels of ethanol and can charge a price of $4 pe ...

What is 4g and its benefits how fast is your internet

What is 4G and its benefits. How fast is your Internet service supposed to be for stationary users?

The freemont automobile factory has discovered that the

The Freemont Automobile Factory has discovered that the longer a worker has been on the job, the more parts the worker can produce. I need help finding an application that computes and displays a worker's anticipated out ...

Question a typical feedback form consists some questions

Question: A typical feedback form consists some questions where students have to give a numerical "grade" and one or more comments fields. Select one or more design platforms and design a preliminary draft of the digital ...

Probability of weather- money youll make during it-rain

Probability of weather- Money you'll make during it- Rain= .6 $80 Mist= .3 $120 Normal= .1 $200 A) What is the mean? B) What is the variance? C) What is the square root of the variance? I believe this is called the sigma ...

Question discuss in 500 words how you would advise your

Question: Discuss, in 500 words, how you would advise your current employer to use encryption to reduce the vulnerabilities of their data at rest, in use, and in transit (or in motion). Identify at what points you think ...

Question draw a map labeling every aspect which represents

Question: Draw a map, labeling every aspect, which represents how IP addressing works with DNS servers to process a request for a web page from your computer that returns the web page.Using tracert from your terminal ent ...

Suppose the probability density function for a random

Suppose the probability density function for a random variable X equals the following:  f(x) = cx 3  for {0 (a) Solve for the value of "c" that makes this a valid pdf. (Hint: please refer to the two necessary conditions ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As