|
|
Re: How to make copy of Resource
|
|
10/28/2011 5:20 PM
post89748
|
Re: How to make copy of Resource
Thomas Haupt wrote:
> I liked the part
> "The increase in the turn around time of high- priority thread is due to the time to stop and save the low-priority
> thread for future execution
There is no need to save the thread environment because the low prio
thread terminates and will be completely restarted.
> and the time to restore the resource object.
.... and the time to create a new shadow image of the resource object.
> We noted that this time for stopping and
> saving 1 thread is 10 milliseconds." Quite a lot of time, even on a Pentium 4.
And then they are talking about performance degradiation by priority
inheritance :)
>
> The crucial part is this here:
> "When priority inversion has been detected i.e. a high-priority thread is not allowed to use a resource
> because of a low-priority thread, the controller object revokes the low priority thread by assigning a true
> value to a lock on the shared resource.
Hm ... I understood that they will create a lock free RCU ?
Seems so if the authors doen't have a consistent view to their concept.
> The threads are designed in such a way that each low-priority thread
> checks the lock variable on resource, periodically. If the lock variable is found false the thread will
> continue its work in the synchronized section otherwise it will preempt itself."
This is not preventing of priority inversion ... it's a hack to resolve
a situation of prio inversion.
>
> You could implement that on top of, e.g., mutexes, of course. You'd have a hard time, though, taking this
> concept into server processes your application depends upon...
>
> And then, of course there is this issue here:
> "Therefore revoking a thread on which a higher priority thread depends will revoke a higher priority thread,
> which is never desired. In order to tackle this problem the proposed approach scans all the dependencies relation
> at compile time. Hence if a high priority thread is dependent on any other thread then that thread is also termed
> as a high priority thread and will never have to wait outside the synchronized section. The dependency relations
> are found by parsing the class files for object instantiation at compile time."
It's a pitty for the work which has been done for the parsing of the
software ...
--Armin
> a) necessity of compile-time analysis makes it rather useless as a general OS-wide technique.
> b) since sync sections behave like ordinary mutexes among "high priority" threads, we're effectively
> thrown back to priority inheritance - only worse...
>
> Cheers,
> Thomas
>
> -----Original Message-----
> From: Armin Steinhoff [mailto:community-noreply@qnx.com]
> Sent: Freitag, 28. Oktober 2011 14:19
> To: ostech-core_os
> Subject: Re: How to make copy of Resource
>
> Thomas Haupt wrote:
>> Armin Steinhoff wrote:
>> [ clip]
>>> IMHO .... someone did misinterpret the concepts of the RCUs:
>>> http://www.rdrop.com/users/paulmck/RCU/whatisRCU.html
>> Not sure. Have you read the original paper by Helmy& Jafri?
> Yes, it's completely nonsens from my point of view ... even if
they are
> talking about "priorty inversion" :)
>
> --Armin
>
>
>> They seem to have implemented something like the OP suggested, but in Java, using special thread-classes and a self-
brewed scheduling mechanism on top of that...
>>
>> - Thomas
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post89672
>>
>>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89722
>
>
>
>
>...
|
|
|
|
|
|
|
Re: How to make copy of Resource
|
|
10/27/2011 11:12 AM
post89685
|
Re: How to make copy of Resource
its the synopsis that u made legend for ...and yes it contains 1:1 copies but as i already said in post89641 that its
work done in WIN XP using JAVA and i want to implement in QNX which is not previously done ...
so i disagree that its" Academically, very bad style"..
After your explanation abt my present approach ..
1] it might be or look now a wrong way to achive the objectives
but i hve left with no choice as i cant have access to process & memory manager code or kernel code...as u said the change in Kernel might work.
2] so ,as i said i am stimulating this approach what the Helmy & Jafri did (stimulation) for WIN XP..i made phone calls to these authors which found :( ...
Thanks & Regards,
Atul Kumbhar
> I took the freedom to read your document, do a
tiny bit of research and
> highlight all those passages in your paper that are 1:1 copies of other
> sources (see below for a legend) without being denoted as such. Not counting
> the impressive title page and your project plan, I found exactly ten (10)
> words that appeared to be written by you, plus three new literature references
> not used anywhere in your paper. Academically, very bad style.
>
> I do assume, though, that you read enough of what you *ahem* cited to enagage
> in a discussion of your proposed approach:
>
> First, as you said yourself, a resource-restitution mechanism will by far not
> work for all types of resources. In fact, it could safely work only with
> 'simple' shared memory - not with devices, not with kernel objects like
> mutexes etc., and also not with memory that could be accessed by other
> processes or devices than the ones involved in your synchronization.
>
> Second, a resource manager will not be able to deliver the functionality you
> are looking to implement; the resource-manager framework itself is based upon
> message-passing (see QNX Neutrino Architecture) which merely takes your trying
> to avoid priority inheritance to a second dimension.
> To really deliver the desired functionality, you'd need to extend the kernel,
> such that backup copies of synchronized data could be taken atomically and
> threads could be reset if necessary.
> But even then, it wouldn't help. Consider this scenario with two threads, TL (
> low) and TH (high priority):
>
> * TL runs, enters synchronized section
> * Backup is taken
> * A signal is delivered to TL, causing some action
> * TH gets running, preempts TL and enters the synchronized section
> * Backup is restored and TL is re-set to beginning of sync section
> * TH blocks
> * TL re-runs the sync section, this time without the signal
>
>
> As for the cited criticism of priority inheritance (or, to use the dedicated
> QNX term for this case, priority boost):
> * The nested critical regions protected by priority inheritance locks generate
> long inversion delays.
> The prerequisite for this to happen is that when TH waits for a lock held by
> TL, TL in turn wants to acquire another lock currently held by yet another
> thread. In real life, you'll aim to avoid this and keep critical sections
> _short_.
>
> * Priority inheritance fails if tasks mix inheriting and non-inheriting
> operations.
> Of course. A helmet fails to protect my head if I take it off.
>
> * Priority inheritance worst case performance is worse than the easy
> alternatives in most cases.
> Victor Yodaiken, author of the nice paper "Against priority inheritance"
> containing this and the other arguments against priority inheritance, suggests
> to "disable preemption" [during critical sections] as a viable and fast
> alternative. Great. That way we're back to priority inversion again.
>
> * Inheritance algorithms are complicated and easy to...
View Full Message
|
|
|
|
|
|
|
AW: Re: How to make copy of Resource
|
|
10/27/2011 12:02 PM
post89695
|
AW: Re: How to make copy of Resource
Please read carefully. I did not say it'd work if you could do it in the kernel. Instead, I showed a scenario which
would never work, even if done in the kernel.
- Thomas
----- Originalnachricht -----
Von: Atul Kumbhar [mailto:community-noreply@qnx.com]
Gesendet: Thursday, October 27, 2011 11:12 AM
An: ostech-core_os <post89685@community.qnx.com>
Betreff: Re: How to make copy of Resource
its the synopsis that u made legend for ...and yes it contains 1:1 copies but as i already said in post89641 that its
work done in WIN XP using JAVA and i want to implement in QNX which is not previously done ...
so i disagree that its" Academically, very bad style"..
After your explanation abt my present approach ..
1] it might be or look now a wrong way to achive the objectives
but i hve left with no choice as i cant have access to process & memory manager code or kernel code...as u said the change in Kernel might work.
2] so ,as i said i am stimulating this approach what the Helmy & Jafri did (stimulation) for WIN XP..i made phone calls to these authors which found :( ...
Thanks & Regards,
Atul Kumbhar
> I took the freedom to read your document, do a
tiny bit of research and
> highlight all those passages in your paper that are 1:1 copies of other
> sources (see below for a legend) without being denoted as such. Not counting
> the impressive title page and your project plan, I found exactly ten (10)
> words that appeared to be written by you, plus three new literature references
> not used anywhere in your paper. Academically, very bad style.
>
> I do assume, though, that you read enough of what you *ahem* cited to enagage
> in a discussion of your proposed approach:
>
> First, as you said yourself, a resource-restitution mechanism will by far not
> work for all types of resources. In fact, it could safely work only with
> 'simple' shared memory - not with devices, not with kernel objects like
> mutexes etc., and also not with memory that could be accessed by other
> processes or devices than the ones involved in your synchronization.
>
> Second, a resource manager will not be able to deliver the functionality you
> are looking to implement; the resource-manager framework itself is based upon
> message-passing (see QNX Neutrino Architecture) which merely takes your trying
> to avoid priority inheritance to a second dimension.
> To really deliver the desired functionality, you'd need to extend the kernel,
> such that backup copies of synchronized data could be taken atomically and
> threads could be reset if necessary.
> But even then, it wouldn't help. Consider this scenario with two threads, TL (
> low) and TH (high priority):
>
> * TL runs, enters synchronized section
> * Backup is taken
> * A signal is delivered to TL, causing some action
> * TH gets running, preempts TL and enters the synchronized section
> * Backup is restored and TL is re-set to beginning of sync section
> * TH blocks
> * TL re-runs the sync section, this time without the signal
>
>
> As for the cited criticism of priority inheritance (or, to use the dedicated
> QNX term for this case, priority boost):
> * The nested critical regions protected by priority inheritance locks generate
> long inversion delays.
> The prerequisite for this to happen is that when TH waits for a lock held by
> TL, TL in turn wants to acquire another lock currently held by yet another
> thread. In real life, you'll aim to avoid this and keep critical sections
> _short_.
>
> * Priority inheritance fails if tasks mix inheriting and non-inheriting
> operations.
> Of course. A helmet fails to protect my head if I take it off.
>
> * Priority inheritance worst case performance is worse than the easy
>...
View Full Message
|
|
|
|
|
|
|
Re: AW: Re: How to make copy of Resource
|
|
10/27/2011 1:08 PM
post89699
|
Re: AW: Re: How to make copy of Resource
Please have a look on post89341 by David Sarrazin ....
Thanks & Regards,
Atul Kumbhar
> Please read carefully. I did not say it'd work if you could do it in the
> kernel. Instead, I showed a scenario which would never work, even if done in
> the kernel.
>
> - Thomas
>
>
|
|
|
|
|
|
|
RE: AW: Re: How to make copy of Resource
|
|
10/28/2011 2:55 AM
post89710
|
RE: AW: Re: How to make copy of Resource
So?
All he says is you can turn off priority inheritance on a message-passing channel, which I didn't deny.
You may also turn off priority inheritance for mutexes and condvars, if you like.
I still do not see how you want to ensure full thread state restorability over the synchronized sections.
Even if it probably doesn't sound like it, my intention is not to bash on your project; it's mostly
to help you reflect on your chances of success. Please consider again the fact that the original
implementation by Helmi & Jafri was at Java level, not at OS level - and what that means in terms of
state information availability.
Regards,
Thomas
-----Original Message-----
From: Atul Kumbhar [mailto:community-noreply@qnx.com]
Sent: Donnerstag, 27. Oktober 2011 19:08
To: ostech-core_os
Subject: Re: AW: Re: How to make copy of Resource
Please have a look on post89341 by David Sarrazin ....
Thanks & Regards,
Atul Kumbhar
> Please read carefully. I did not say it'd work if you could do it in the
> kernel. Instead, I showed a scenario which would never work, even if done in
> the kernel.
>
> - Thomas
>
>
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post89699
|
|
|
|
|
|
|
Re: How to make copy of Resource
|
|
10/28/2011 7:46 AM
post89717
|
Re: How to make copy of Resource
Atul Kumbhar wrote:
> Please have a look on post89341 by David Sarrazin ....
BTW ... I did the same proposal :)
Some questions:
What happens if two threads of the low priority group running at
different priorities are trying to update the resource ? Synchronization?
What about performance?
When a low priority task spent a lot of time in processing of a shared
resource all CPU time will be lost after preemption (or abort) by a high
priority thread.
This happens while the low prio thread must be aborted and completely
restarted creating a new copy of the resource! That's really wast of
CPU time :)
This very special RCU scheme could also not be used as a common solution
for avoiding priority inversion.
The handling of priority inheritance is much more general and doesn't
kill the performance of a system.
--Armin
PS: scheduling should handle the CPU and not concurrent use of resources.
>
> Thanks& Regards,
> Atul Kumbhar
>
>
>
>
>
>> Please read carefully. I did not say it'd work if you could do it in the
>> kernel. Instead, I showed a scenario which would never work, even if done in
>> the kernel.
>>
>> - Thomas
>>
>>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89699
>
>
|
|
|
|
|
|