Re: sleep is not working to avoid starvation among threads of same priority

2008-10-07 Thread Jeremy Chadwick
On Tue, Oct 07, 2008 at 03:34:41PM +0530, Rajeshwar Patil wrote:
> I have two threads of same priority lets say thread A and thread B,
> thread A is starving since thread B has got a for loop of size 100k.
> So, to avoid starvation I am processing 1000 iterations of for
> loop(that of thread B) in one batch and giving sleep of 1ms, but still
> thread A is starving. If I increase the batch size used in for loop
> from 1k to 10k then starvation of thread A is little less whereas it
> should be more as Im increasing processing time of thread B. I tried
> various combinations of sleeps and batches, but I couldnt solve the
> starvation of thread A.
> 
> Is the sleep right solution?
> 
> I will be grateful if someone could answer on this.

This might be a question for freebsd-hackers, which is more
developer-oriented than -questions.

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


sleep is not working to avoid starvation among threads of same priority

2008-10-07 Thread Rajeshwar Patil
Hi,

I have two threads of same priority lets say thread A and thread B, thread A is 
starving since thread B has got a for loop of size 100k. So, to avoid 
starvation I am processing 1000 iterations of for loop(that of thread B) in one 
batch and giving sleep of 1ms, but still thread A is starving. If I increase 
the batch size used in for loop from 1k to 10k then starvation of thread A is 
little less whereas it should be more as Im increasing processing time of 
thread B. I tried various combinations of sleeps and batches, but I couldnt 
solve the starvation of thread A.

Is the sleep right solution?

I will be grateful if someone could answer on this.

Thanks
Rajeshwar







"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


sleep is not working to avoid starvation among threads of same priority

2008-10-07 Thread Rajeshwar Patil
Hi,

I have two threads of same priority lets say thread A and thread B, thread A is 
starving since thread B has got a for loop of size 100k. So, to avoid 
starvation I am processing 1000 iterations of for loop(that of thread B) in one 
batch and giving sleep of 1ms, but still thread A is starving. If I increase 
the batch size used in for loop from 1k to 10k then starvation of thread A is 
little less whereas it should be more as Im increasing processing time of 
thread B. I tried various combinations of sleeps and batches, but I couldnt 
solve the starvation of thread A.

Is the sleep right solution?

I will be grateful if someone could answer on this.

Thanks
Rajeshwar







"DISCLAIMER: This message is proprietary to Aricent and is intended solely for 
the use of the individual to whom it is addressed. It may contain privileged or 
confidential information and should not be circulated or used for any purpose 
other than for what it is intended. If you have received this message in 
error,please notify the originator immediately. If you are not the intended 
recipient, you are notified that you are strictly prohibited from using, 
copying, altering, or disclosing the contents of this message. Aricent accepts 
no responsibility for loss or damage arising from the use of the information 
transmitted by this email including damage from virus."
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"