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.:- M9718116

Have any Question?


Related Questions in Computer Engineering

What decimal number does the bit pattern 0xc0d40000

What decimal number does the bit pattern 0xC0D40000 represent if it is: A two's complement integer An unsigned integer A floating point number assuming the IEE 754 single precision format Please provide a detailed explan ...

Whats the difference between a bigfile tablespace and a

What's the difference between a Bigfile tablespace and a Smallfile tablespace? Explain which you would use for your database and why.

Describe an ethical conundrum found in a magazine or

Describe an ethical conundrum found in a magazine or newspaper article, and please give your own thoughts. Give good citations, of course.

Suppose youve designed a mips processor implementation in

Suppose you've designed a MIPS processor implementation in which the stages take the following lengths of time: IF=20ns, ID=10ns, EX=20ns, MEM=35ns, WB=10ns. What is the minimum clock period for which your processor func ...

Command to mail only the process id of running java program

Command to mail only the process ID of running Java program test to the email address (single line Unix)

Are risk-averse people more likely to order their steak

Are risk-averse people more likely to order their steak well-done? A survey was conducted that asked individuals a series of questions about risk and how the individual prefers their steak (if at all). In particular, one ...

Scheduling algorithms are again becoming more important as

Scheduling algorithms are again becoming more important as we look at operating system that run on mobile devices. Are their scheduling algorithms different from those found on traditional interactive system? Compare and ...

Question suppose that we have a set of activities to

Question : Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in any lecture hall. We wish to schedule all the activities using as few lecture ha ...

Suppose a 4 packets of a message each of size 10 mbit

Suppose a 4 packets of a message, each of size 10 Mbit arrive simultaneously at a switch preceding a transmission link of rate 5 Mbps connecting to the destination host. (a) What is the average queuing delay experienced ...

Question suppose that the tuition for a university is 10000

Question : Suppose that the tuition for a university is $10,000 this year and increases 5% every year. In one year, the tuition will be $10, 500. Write a program that displays the tuition in ten years and the total cost ...

  • 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