Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2008 16:08:22 +0530
From:      Ramachandran Sathyanarayanan <Ramachandran.Sathyanarayanan@aricent.com>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Cc:        Rajeshwar Patil <Rajeshwar.Patil@aricent.com>
Subject:   sleep is not working to avoid starvation among threads of same priority
Message-ID:  <B110A82B42E4E547B2A622349609CC1E2D21B5303C@GUREXMB02.ASIAN.AD.ARICENT.COM>

next in thread | raw e-mail | index | archive | help
Hi

 I hope this is the right mailer for this question. pls let us know your in=
puts on this.

Thanks

Ram

________________________________
From: Rajeshwar Patil
Sent: Tuesday, October 07, 2008 3:36 PM
To: freebsd-questions@freebsd.org
Cc: Ramachandran Sathyanarayanan; Rajeshwar Patil
Subject: sleep is not working to avoid starvation among threads of same pri=
ority

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 in=
crease the batch size used in for loop from 1k to 10k then starvation of th=
read 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 privi=
leged 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 m=
essage in error,please notify the originator immediately. If you are not th=
e intended recipient, you are notified that you are strictly prohibited fro=
m using, copying, altering, or disclosing the contents of this message. Ari=
cent accepts no responsibility for loss or damage arising from the use of t=
he information transmitted by this email including damage from virus."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B110A82B42E4E547B2A622349609CC1E2D21B5303C>