473,698 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help, THREADS problem (producers and consumers) !


Hello!

I am trying to implement a program that uses Threads. I chose the producers
and consumers scenario. The producers put a "product" (which is an int
number) in a shared storage place of one position. The consumers must
consume all the products that are put in the storage place.

The user of the program enters how many products it will be produced, and
also, how many producers and consumers (each one in a separate thread) there
will be.

My program is not working ok... When I choose a high number of producers
(let's say 5), and a low number of consumers (let's say 2), it doesn't work
well.. I can't spot where the problem is.

Here is the code... Thanks in advance for any help !

Leo Hyppolito

---

using System;
using System.Threadin g;
namespace TesteProdCons
{
// can hold 1 product at a time (buffer of 1 position)
public class Storage
{
// represents the product (a delay in miliseconds)
// -1 is "empty"
private int p;
// actual product number
private int n;

// number of products (max) to be produced
private int nMax;
public int Product
{
get
{
lock(this)
{
// if it's empty, wait
if(p == -1)
{
Console.WriteLi ne("CONSUMER [" + Thread.CurrentT hread.Name + "] has to
wait (storage is empty)");
Monitor.Wait(th is);
}
// read the product
int ret = p;

// empty the buffer (so that it can receive a new product)
p = -1;
// signal the next pending thread to move on
Monitor.Pulse(t his);

// return the product value
return ret;
}
}
set
{
lock(this)
{
// if it has a product, wait
if(p != -1)
{
Console.WriteLi ne("PRODUCER [" + Thread.CurrentT hread.Name + "] has to
wait (storage is full)");
Monitor.Wait(th is);
}
// store the product
p = value;
// write information on screen
Console.WriteLi ne("++ [" + Thread.CurrentT hread.Name + "] produces n."
+ Number + ": " + p);

// increment the actual product number
Number = Number + 1;
// signal the next pending thread to move on
Monitor.Pulse(t his);
}
}
}
public int Number
{
get {return n;}
set {n = value;}
}
public int MaxNumber
{
get
{
lock(this)
{
return nMax;
}
}
set {nMax = value;}
}
// constructor
public Storage(int i)
{
p = -1;
Number = 1;
MaxNumber = i;
}
}
public class Producer
{
// a reference to the storage
private Storage a;
// seed for the random
private int seed;
// constructor
public Producer(Storag e arm, int s)
{
a = arm;
seed = s;
}
public void produce()
{
Random r = new Random(seed);
while(a.Number <= a.MaxNumber)
{
// get a random integer (from 0 to 2 seconds)
int prod = r.Next(2001);

// store the product
a.Product = prod;

// rest for a while...
Thread.Sleep(50 0);
}
}
}
public class Consumer
{
// a reference to the storage
Storage a;
// constructor
public Consumer(Storag e arm)
{
a = arm;
}
public void consume()
{
while(true)
{
// get the product value
int prod = a.Product;
// "consume" the product (pauses for the product's miliseconds)
Thread.Sleep(pr od);

Console.WriteLi ne("-- [" + Thread.CurrentT hread.Name + "] consumed " +
prod);
}
}
}
class Class1
{
static void Main(string[] args)
{
int numProducts;
int numProducers;
int numConsumers;
Console.Write(" Max number of products: ");
numProducts = Int32.Parse(Con sole.ReadLine() );
Console.Write(" Number of producers: ");
numProducers = Int32.Parse(Con sole.ReadLine() );
Console.Write(" Numero of consumers: ");
numConsumers = Int32.Parse(Con sole.ReadLine() );
Storage a = new Storage(numProd ucts);
Producer[] prod = new Producer[numProducers];
Consumer[] cons = new Consumer[numConsumers];
Thread[] tProd = new Thread[numProducers];
Thread[] tCons = new Thread[numConsumers];
Random r = new Random();
// create the producers objects and threads
for(int i = 0; i < numProducers; i++)
{
prod[i] = new Producer(a, r.Next(999999)) ;
tProd[i] = new Thread(new ThreadStart(pro d[i].produce));
tProd[i].Name = "p" + (i+1);
}
// create the consumers objects and threads
for(int i = 0; i < numConsumers; i++)
{
cons[i] = new Consumer(a);
tCons[i] = new Thread(new ThreadStart(con s[i].consume));
tCons[i].Name = "c" + (i+1);
}

// start the threads
foreach (Thread t in tProd) {t.Start();}
foreach (Thread t in tCons) {t.Start();}

Console.WriteLi ne("Storage, producers and consumers created!");
}
}
}
Nov 15 '05 #1
5 1567

I forgot to include the program output:

The problem is:
it is producing OK, mas the consumers are NOT consuming all the products.

Here is the output:

---
Max number of products: 10
Number of producers: 3
Numero of consumers: 1
Storage, producers and consumers created!
++ [p1] produces n.1: 1576
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
++ [p2] produces n.2: 16
++ [p3] produces n.3: 1872
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1576
++ [p1] produces n.4: 1769
++ [p2] produces n.5: 687
++ [p3] produces n.6: 1117
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1872
++ [p1] produces n.7: 539
++ [p2] produces n.8: 515
++ [p3] produces n.9: 990
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1117
++ [p1] produces n.10: 1662
++ [p2] produces n.11: 288
++ [p3] produces n.12: 1049
-- [c1] consumed 990
-- [c1] consumed 1049
CONSUMER [c1] has to wait (storage is empty)

Thanks
Nov 15 '05 #2
There is a bug in the synchronization mechanism you are using.
Suppose 3 producers (pA pB pC ) try to set the value of Storage.Product , and
cD is a consumer:
1. pA enters the locked section, fills the slot in Storage, and exits
2. pB enters, the slot is full, so it blocks on the Wait call (the lock is
released)
3. pC enters, the slot is full, so it blocks on the Wait call (the lock is
released)
4. cD consumes the slot, pulses, so the next thread ready to execute will be
pB
5. pB continues its execution, fills the slot and pulses the monitor, so the
next thread ready to execute is pC
6. pC continues its execution, and fill the slot, BUT THE SLOT WAS FULL!!!!

The actual problem is that you are using the same synchronization object,
for marking the storage as free or full. You must use two entities.

In order to prove what I've said, add the marked line to your code, and see
what happens...

Console.WriteLi ne("PRODUCER [" + Thread.CurrentT hread.Name + "] has to
wait (storage is full)");
Monitor.Wait(th is);
}

--> if (p != -1) Console.WriteLi ne("You are in trouble!");
// store the product
p = value;
Have a nice day
GV

"Leonardo Hyppolito" <le**********@u ol.com.br> wrote in message
news:uK******** ******@TK2MSFTN GP11.phx.gbl...

I forgot to include the program output:

The problem is:
it is producing OK, mas the consumers are NOT consuming all the products.

Here is the output:

---
Max number of products: 10
Number of producers: 3
Numero of consumers: 1
Storage, producers and consumers created!
++ [p1] produces n.1: 1576
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
++ [p2] produces n.2: 16
++ [p3] produces n.3: 1872
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1576
++ [p1] produces n.4: 1769
++ [p2] produces n.5: 687
++ [p3] produces n.6: 1117
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1872
++ [p1] produces n.7: 539
++ [p2] produces n.8: 515
++ [p3] produces n.9: 990
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
-- [c1] consumed 1117
++ [p1] produces n.10: 1662
++ [p2] produces n.11: 288
++ [p3] produces n.12: 1049
-- [c1] consumed 990
-- [c1] consumed 1049
CONSUMER [c1] has to wait (storage is empty)

Thanks

Nov 15 '05 #3

Gianluca, thanks a lot for you answer! I could understand where the problem
is.

I tried to fix it, using distinct objects for synchornization . Here is
the new code:

---
using System;

using System.Threadin g;

namespace TesteProdCons

{

// can hold 1 product at a time (buffer of 1 position)

public class Storage

{

private object syncProd;

private object syncCons;

// represents the product (a delay in miliseconds)

// -1 is "empty"

private int p;

// actual product number

private int n;
// number of products (max) to be produced

private int nMax;

public int Product

{

get

{

lock(syncCons)

{

// if it's empty, wait

if(p == -1)

{

Console.WriteLi ne("CONSUMER [" + Thread.CurrentT hread.Name + "] has to wait
(storage is empty)");

Monitor.Wait(sy ncCons);

}

// read the product

int ret = p;
// empty the buffer (so that it can receive a new product)

p = -1;

// signal the next pending thread to move on

Monitor.Pulse(s yncCons);
// return the product value

return ret;

}

}

set

{

lock(syncProd)

{

// if it has a product, wait

if(p != -1)

{

Console.WriteLi ne("PRODUCER [" + Thread.CurrentT hread.Name + "] has to wait
(storage is full)");

Monitor.Wait(sy ncProd);

}

// store the product

p = value;

// write information on screen

Console.WriteLi ne("++ [" + Thread.CurrentT hread.Name + "] produces n." +
Number + ": " + p);
// increment the actual product number

Number = Number + 1;

// signal the next pending thread to move on

Monitor.Pulse(s yncProd);

}

}

}

public int Number

{

get {return n;}

set

{

lock(this)

{

n = value;

}

}

}

public int MaxNumber

{

get

{

lock(this)

{

return nMax;

}

}

set {nMax = value;}

}

// constructor

public Storage(int i)

{

p = -1;

Number = 1;

MaxNumber = i;

syncProd = new object();

syncCons = new object();

}

}

public class Producer

{

// a reference to the storage

private Storage a;

// seed for the random

private int seed;

// constructor

public Producer(Storag e arm, int s)

{

a = arm;

seed = s;

}

public void produce()

{

Random r = new Random(seed);

while(a.Number <= a.MaxNumber)

{

// get a random integer (from 0 to 2 seconds)

int prod = r.Next(2001);
// store the product

a.Product = prod;
// rest for a while...

Thread.Sleep(50 0);

}

}

}

public class Consumer

{

// a reference to the storage

Storage a;

// constructor

public Consumer(Storag e arm)

{

a = arm;

}

public void consume()

{

while(true)

{

// get the product value

int prod = a.Product;

// "consume" the product (pauses for the product's miliseconds)

Thread.Sleep(pr od);
Console.WriteLi ne("-- [" + Thread.CurrentT hread.Name + "] consumed " +
prod);

}

}

}

class Class1

{

static void Main(string[] args)

{

int numProducts;

int numProducers;

int numConsumers;

Console.Write(" Max number of products: ");

numProducts = Int32.Parse(Con sole.ReadLine() );

Console.Write(" Number of producers: ");

numProducers = Int32.Parse(Con sole.ReadLine() );

Console.Write(" Numero of consumers: ");

numConsumers = Int32.Parse(Con sole.ReadLine() );

Storage a = new Storage(numProd ucts);

Producer[] prod = new Producer[numProducers];

Consumer[] cons = new Consumer[numConsumers];

Thread[] tProd = new Thread[numProducers];

Thread[] tCons = new Thread[numConsumers];

Random r = new Random();

// create the producers objects and threads

for(int i = 0; i < numProducers; i++)

{

prod[i] = new Producer(a, r.Next(999999)) ;

tProd[i] = new Thread(new ThreadStart(pro d[i].produce));

tProd[i].Name = "p" + (i+1);

}

// create the consumers objects and threads

for(int i = 0; i < numConsumers; i++)

{

cons[i] = new Consumer(a);

tCons[i] = new Thread(new ThreadStart(con s[i].consume));

tCons[i].Name = "c" + (i+1);

}
// start the threads

foreach (Thread t in tProd) {t.Start();}

foreach (Thread t in tCons) {t.Start();}
Console.WriteLi ne("Storage, producers and consumers created!");

}

}

}

---

However, it didn't work..... Here's the output:

Max number of products: 10
Number of producers: 3
Numero of consumers: 1
Storage, producers and consumers created!
++ [p1] produces n.1: 924
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
++ [p1] produces n.2: 1169
++ [p2] produces n.3: 1503
++ [p3] produces n.4: 1483
-- [c1] consumed 924
++ [p2] produces n.5: 77
PRODUCER [p3] has to wait (storage is full)
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
-- [c1] consumed 1483
-- [c1] consumed 77
CONSUMER [c1] has to wait (storage is empty)

---

Any idea on what's wrong?

Thanks again,

Leonardo Hyppolito
Nov 15 '05 #4

Sorry , the code lost identation...

But I published it in a "paste" website... The URL is :

http://www.rafb.net/paste/results/Q2558064.html

Thanks !

Nov 15 '05 #5
Here is some code that works, by using two autoreset events (in practice
they act as two 1 slot semaphores).

Have a nice day
GV
using System;
using System.Threadin g;
namespace TesteProdCons
{
// can hold 1 product at a time (buffer of 1 position)
public class Storage
{
private AutoResetEvent FilledEvent = new AutoResetEvent( false);
private AutoResetEvent VoidEvent = new AutoResetEvent( true);

private int p;

// actual product number
private int n;

// number of products (max) to be produced
private int nMax;
public int Product
{
get
{
FilledEvent.Wai tOne();

int ret = p;

VoidEvent.Set() ;

return ret;
}
set
{
VoidEvent.WaitO ne();

p = value;

Console.WriteLi ne("++ [" + Thread.CurrentT hread.Name + "] produces n." +
Number + ": " + p);
Number = Number + 1;

FilledEvent.Set ();
}
}
public int Number
{
get {return n;}
set {n = value;}
}
public int MaxNumber
{
get
{
// lock(this)
// {
return nMax;
// }
}
set {nMax = value;}
}
// constructor
public Storage(int i)
{
Number = 1;
MaxNumber = i;
}
}
public class Producer
{
// a reference to the storage
private Storage a;
// seed for the random
private int seed;
// constructor
public Producer(Storag e arm, int s)
{
a = arm;
seed = s;
}
public void produce()
{
Random r = new Random(seed);
while(a.Number <= a.MaxNumber)
{
// get a random integer (from 0 to 2 seconds)
int prod = r.Next(2001);

// store the product
a.Product = prod;

// rest for a while...
Thread.Sleep(50 0);
}
}
}
public class Consumer
{
// a reference to the storage
Storage a;
// constructor
public Consumer(Storag e arm)
{
a = arm;
}
public void consume()
{
while(true)
{
// get the product value
int prod = a.Product;
// "consume" the product (pauses for the product's miliseconds)
Thread.Sleep(pr od);

Console.WriteLi ne("-- [" + Thread.CurrentT hread.Name + "] consumed " +
prod);
}
}
}
class Class1
{
static void Main(string[] args)
{
int numProducts;
int numProducers;
int numConsumers;
Console.Write(" Max number of products: ");
numProducts = Int32.Parse(Con sole.ReadLine() );
Console.Write(" Number of producers: ");
numProducers = Int32.Parse(Con sole.ReadLine() );
Console.Write(" Numero of consumers: ");
numConsumers = Int32.Parse(Con sole.ReadLine() );
Storage a = new Storage(numProd ucts);
Producer[] prod = new Producer[numProducers];
Consumer[] cons = new Consumer[numConsumers];
Thread[] tProd = new Thread[numProducers];
Thread[] tCons = new Thread[numConsumers];
Random r = new Random();
// create the producers objects and threads
for(int i = 0; i < numProducers; i++)
{
prod[i] = new Producer(a, r.Next(999999)) ;
tProd[i] = new Thread(new ThreadStart(pro d[i].produce));
tProd[i].Name = "p" + (i+1);
}
// create the consumers objects and threads
for(int i = 0; i < numConsumers; i++)
{
cons[i] = new Consumer(a);
tCons[i] = new Thread(new ThreadStart(con s[i].consume));
tCons[i].Name = "c" + (i+1);
}

// start the threads
foreach (Thread t in tProd) {t.Start();}
foreach (Thread t in tCons) {t.Start();}

Console.WriteLi ne("Storage, producers and consumers created!");
}
}
}

"Leonardo Hyppolito" <le**********@u ol.com.br> wrote in message
news:OO******** ******@TK2MSFTN GP10.phx.gbl...

Gianluca, thanks a lot for you answer! I could understand where the problem is.

I tried to fix it, using distinct objects for synchornization . Here is
the new code:

---
using System;

using System.Threadin g;

namespace TesteProdCons

{

// can hold 1 product at a time (buffer of 1 position)

public class Storage

{

private object syncProd;

private object syncCons;

// represents the product (a delay in miliseconds)

// -1 is "empty"

private int p;

// actual product number

private int n;
// number of products (max) to be produced

private int nMax;

public int Product

{

get

{

lock(syncCons)

{

// if it's empty, wait

if(p == -1)

{

Console.WriteLi ne("CONSUMER [" + Thread.CurrentT hread.Name + "] has to wait (storage is empty)");

Monitor.Wait(sy ncCons);

}

// read the product

int ret = p;
// empty the buffer (so that it can receive a new product)

p = -1;

// signal the next pending thread to move on

Monitor.Pulse(s yncCons);
// return the product value

return ret;

}

}

set

{

lock(syncProd)

{

// if it has a product, wait

if(p != -1)

{

Console.WriteLi ne("PRODUCER [" + Thread.CurrentT hread.Name + "] has to wait (storage is full)");

Monitor.Wait(sy ncProd);

}

// store the product

p = value;

// write information on screen

Console.WriteLi ne("++ [" + Thread.CurrentT hread.Name + "] produces n." +
Number + ": " + p);
// increment the actual product number

Number = Number + 1;

// signal the next pending thread to move on

Monitor.Pulse(s yncProd);

}

}

}

public int Number

{

get {return n;}

set

{

lock(this)

{

n = value;

}

}

}

public int MaxNumber

{

get

{

lock(this)

{

return nMax;

}

}

set {nMax = value;}

}

// constructor

public Storage(int i)

{

p = -1;

Number = 1;

MaxNumber = i;

syncProd = new object();

syncCons = new object();

}

}

public class Producer

{

// a reference to the storage

private Storage a;

// seed for the random

private int seed;

// constructor

public Producer(Storag e arm, int s)

{

a = arm;

seed = s;

}

public void produce()

{

Random r = new Random(seed);

while(a.Number <= a.MaxNumber)

{

// get a random integer (from 0 to 2 seconds)

int prod = r.Next(2001);
// store the product

a.Product = prod;
// rest for a while...

Thread.Sleep(50 0);

}

}

}

public class Consumer

{

// a reference to the storage

Storage a;

// constructor

public Consumer(Storag e arm)

{

a = arm;

}

public void consume()

{

while(true)

{

// get the product value

int prod = a.Product;

// "consume" the product (pauses for the product's miliseconds)

Thread.Sleep(pr od);
Console.WriteLi ne("-- [" + Thread.CurrentT hread.Name + "] consumed " +
prod);

}

}

}

class Class1

{

static void Main(string[] args)

{

int numProducts;

int numProducers;

int numConsumers;

Console.Write(" Max number of products: ");

numProducts = Int32.Parse(Con sole.ReadLine() );

Console.Write(" Number of producers: ");

numProducers = Int32.Parse(Con sole.ReadLine() );

Console.Write(" Numero of consumers: ");

numConsumers = Int32.Parse(Con sole.ReadLine() );

Storage a = new Storage(numProd ucts);

Producer[] prod = new Producer[numProducers];

Consumer[] cons = new Consumer[numConsumers];

Thread[] tProd = new Thread[numProducers];

Thread[] tCons = new Thread[numConsumers];

Random r = new Random();

// create the producers objects and threads

for(int i = 0; i < numProducers; i++)

{

prod[i] = new Producer(a, r.Next(999999)) ;

tProd[i] = new Thread(new ThreadStart(pro d[i].produce));

tProd[i].Name = "p" + (i+1);

}

// create the consumers objects and threads

for(int i = 0; i < numConsumers; i++)

{

cons[i] = new Consumer(a);

tCons[i] = new Thread(new ThreadStart(con s[i].consume));

tCons[i].Name = "c" + (i+1);

}
// start the threads

foreach (Thread t in tProd) {t.Start();}

foreach (Thread t in tCons) {t.Start();}
Console.WriteLi ne("Storage, producers and consumers created!");

}

}

}

---

However, it didn't work..... Here's the output:

Max number of products: 10
Number of producers: 3
Numero of consumers: 1
Storage, producers and consumers created!
++ [p1] produces n.1: 924
PRODUCER [p2] has to wait (storage is full)
PRODUCER [p3] has to wait (storage is full)
++ [p1] produces n.2: 1169
++ [p2] produces n.3: 1503
++ [p3] produces n.4: 1483
-- [c1] consumed 924
++ [p2] produces n.5: 77
PRODUCER [p3] has to wait (storage is full)
PRODUCER [p1] has to wait (storage is full)
PRODUCER [p2] has to wait (storage is full)
-- [c1] consumed 1483
-- [c1] consumed 77
CONSUMER [c1] has to wait (storage is empty)

---

Any idea on what's wrong?

Thanks again,

Leonardo Hyppolito

Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
2431
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next = gen.next() finally:
23
2485
by: Antoon Pardon | last post by:
I have had a look at the signal module and the example and came to the conclusion that the example wont work if you try to do this in a thread. So is there a chance similar code will work in a thread? -- Antoon Pardon
4
3131
by: Jeff T. | last post by:
Hello, I have an existing set of C# classes that encapsulate our application data. They are in a heirachy with each subclass defining more specific types of data. I would like to serialize these data objects as XML but perserve the relationships in the XML document. For example, if my classes were: public class GenericItem { }
4
1975
by: Leonardo Hyppolito | last post by:
Hello, I am trying to write a multithread program that simulates producers and consumers. My program can have many producers and many consumers (each in a separate thread). It has a storage place (buffer) with "n" capacity. The user provides these parameters on startup. The buffer works with a circular queue. It's a console application. My implementation is working with Semaphores to synchornize everything. I think it's synchornized...
2
1466
by: suraj | last post by:
..NET Interview Questions http://blogs.crsw.com/mark/articles/2542.aspx http://www.geocities.com/dotnetinterviews/ http://blog.daveranck.com/archive/2005/01/20/3553.aspx http://www.dotnetspider.com/technology/exams/ExamsCategory.aspx?CategoryId=3 http://techinterviews.com/ http://www.certfaq.com/employment/e011.html SQL Server Interview questions
15
2574
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to determine who needs to receive the text message then send the message to the address. Only problem is, the employee may receive up to 4 of the same messages because each thread gets the recors then sends the message. I need somehow to prevent...
2
1979
by: hanshirley88 | last post by:
Hi, I am doing an expense and funding report which contains a list of consumers by Region and then by SiteID. For example, Region: NE Site: NEMV 1. Mary Doe 2. Len Willams
167
8293
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an object should run in its own thread, it should implement this mix-in class. Does this sound like plausible design decision? I'm surprised that C++ doesn't have such functionality, say in its STL. This absence of a thread/object relationship in...
36
1462
by: kaps | last post by:
Hello What is the best IDE to use for C/C++ languages? Previously I used "turbo c" compiler on Windows XP. But now I switched to Windows Vista where I cant use it. I tried to setup CDT eclipse but could not compile C program. Can somebody please tell me which IDE is best and from where to
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9027
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.