Computing desk | ||
---|---|---|
< October 29 | << Sep | October | Nov >> | October 31 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
need small python script to do global find and replace with a plain text file. 70.114.254.43 ( talk) 02:58, 30 October 2012 (UTC)
i know that due to multithreading cpu idle time is reduced.
when cpu is free or waiting for input or output then it starts execution of another thread.
I am expressing my doubts based on below programme.
class thread6
{
public static void main(String args[])
{
Thread count1=new Thread(new CountDownEven());
Thread t=Thread.currentThread();
count1.start();
for(int i=11;i<=20;i=i+2)
{
System.out.println(t.getName()+"----"+i);
}
}
}
class CountDownEven implements Runnable
{
public void run()
{
Thread t=Thread.currentThread();
for(int i=0;i<10;i=i+2)
{
System.out.println(t.getName()+"----"+i);
}
}
}
my doubts:
outputs of above programme:
out put1
Thread-0----0
main----11
Thread-0----2
Thread-0----4
Thread-0----6
main----13
main----15
main----17
main----19
Thread-0----8
output2
Thread-0----0
Thread-0----2
Thread-0----4
main----11
main----13
main----15
Thread-0----6
Thread-0----8
main----17
main----19
output3:
main----11
Thread-0----0
Thread-0----2
main----13
main----15
main----17
main----19
Thread-0----4
Thread-0----6
Thread-0----8
— Preceding unsigned comment added by Phanihup ( talk • contribs) 05:48, 30 October 2012 (UTC)
I want the several sheets in a spreadsheet to be multiple "views" into the same data. If I insert or delete a row in one sheet, I want it to be simultaneously inserted/deleted across all sheets. Is there any way to do that? Thanks. — Preceding unsigned comment added by 141.154.221.145 ( talk) 09:30, 30 October 2012 (UTC)
I am completing this lab for a class. I have reached the point where I need to code the T out of asterisks.
My code is as follows:
#include <stdio.h>
#include <stdlib.h>
void starL(int width, int height)
{
int i;
// check if parameters are valid
if ((width<2) || (height < 2) || (width%2==0))
return; // return without printing anything
// print width stars, followed by a final \n
for (i=0; i<width; i++)
printf("*");
// print height-1 rows of *\n
for (i=0; i<height-1; i++)
printf("*\n");
printf("\n");
return; // we are finished
}
The problem is, when I attempt to generate a 3x3 T, I get:
**** *
I somehow need to make the "width" line go above the "height" line, and then have the height line spaced (width/2) columns over. How would I do that? 169.231.8.73 ( talk) 11:54, 30 October 2012 (UTC)
Are the specifications/dimensions of the MD1 and MD2 form factors for PCIe x1, x4 & x8 cards available anywhere online for free? My computer accepts regular cards, but I'm just curious to learn more about these exotic enterprisey form factors. — Preceding unsigned comment added by 49.245.15.32 ( talk) 13:24, 30 October 2012 (UTC)
Suppose I have a multiprocessor machine and I want to write multiprocess program in C/C++,
which will run on separate processors on the machine and will allocate and access shared memory by Linux system calls,
such as shmget()
, shmat()
and mmap()
etc. Do I ever need to cope with cache coherence by explicitly invalidating/flushing CPU caches in the program? Or it's the Linux and/or the hardware
will do this for me? I'm confused because as it's stated in
Shared memory: "care must be taken to avoid issues if processes sharing memory are running on separate CPUs and the underlying architecture is not cache coherent". --
Justin545 (
talk)
22:27, 30 October 2012 (UTC)
Computing desk | ||
---|---|---|
< October 29 | << Sep | October | Nov >> | October 31 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
need small python script to do global find and replace with a plain text file. 70.114.254.43 ( talk) 02:58, 30 October 2012 (UTC)
i know that due to multithreading cpu idle time is reduced.
when cpu is free or waiting for input or output then it starts execution of another thread.
I am expressing my doubts based on below programme.
class thread6
{
public static void main(String args[])
{
Thread count1=new Thread(new CountDownEven());
Thread t=Thread.currentThread();
count1.start();
for(int i=11;i<=20;i=i+2)
{
System.out.println(t.getName()+"----"+i);
}
}
}
class CountDownEven implements Runnable
{
public void run()
{
Thread t=Thread.currentThread();
for(int i=0;i<10;i=i+2)
{
System.out.println(t.getName()+"----"+i);
}
}
}
my doubts:
outputs of above programme:
out put1
Thread-0----0
main----11
Thread-0----2
Thread-0----4
Thread-0----6
main----13
main----15
main----17
main----19
Thread-0----8
output2
Thread-0----0
Thread-0----2
Thread-0----4
main----11
main----13
main----15
Thread-0----6
Thread-0----8
main----17
main----19
output3:
main----11
Thread-0----0
Thread-0----2
main----13
main----15
main----17
main----19
Thread-0----4
Thread-0----6
Thread-0----8
— Preceding unsigned comment added by Phanihup ( talk • contribs) 05:48, 30 October 2012 (UTC)
I want the several sheets in a spreadsheet to be multiple "views" into the same data. If I insert or delete a row in one sheet, I want it to be simultaneously inserted/deleted across all sheets. Is there any way to do that? Thanks. — Preceding unsigned comment added by 141.154.221.145 ( talk) 09:30, 30 October 2012 (UTC)
I am completing this lab for a class. I have reached the point where I need to code the T out of asterisks.
My code is as follows:
#include <stdio.h>
#include <stdlib.h>
void starL(int width, int height)
{
int i;
// check if parameters are valid
if ((width<2) || (height < 2) || (width%2==0))
return; // return without printing anything
// print width stars, followed by a final \n
for (i=0; i<width; i++)
printf("*");
// print height-1 rows of *\n
for (i=0; i<height-1; i++)
printf("*\n");
printf("\n");
return; // we are finished
}
The problem is, when I attempt to generate a 3x3 T, I get:
**** *
I somehow need to make the "width" line go above the "height" line, and then have the height line spaced (width/2) columns over. How would I do that? 169.231.8.73 ( talk) 11:54, 30 October 2012 (UTC)
Are the specifications/dimensions of the MD1 and MD2 form factors for PCIe x1, x4 & x8 cards available anywhere online for free? My computer accepts regular cards, but I'm just curious to learn more about these exotic enterprisey form factors. — Preceding unsigned comment added by 49.245.15.32 ( talk) 13:24, 30 October 2012 (UTC)
Suppose I have a multiprocessor machine and I want to write multiprocess program in C/C++,
which will run on separate processors on the machine and will allocate and access shared memory by Linux system calls,
such as shmget()
, shmat()
and mmap()
etc. Do I ever need to cope with cache coherence by explicitly invalidating/flushing CPU caches in the program? Or it's the Linux and/or the hardware
will do this for me? I'm confused because as it's stated in
Shared memory: "care must be taken to avoid issues if processes sharing memory are running on separate CPUs and the underlying architecture is not cache coherent". --
Justin545 (
talk)
22:27, 30 October 2012 (UTC)