Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - How to make copy of Resource : Page 1 of 2 (31 Items)
   
How to make copy of Resource  
How to make copy of Resource 
              
                 Please see the attachment ...
To implement / Stimulate the said concept ..
1]i am developing Resource Manager for handling the resource(e.g. serial port)...all resources cannot follow  this 
approach..
2]then create client to generate threads of only TWO priorities High and Low...
3] the problem is


a]How to make copy of Resource
 (i think using multiple thread RM can handle this but how....)..
  Please share our views/suggestions...

 
Thank You,
Atul Kumbhar
Attachment: Word Evasion of Priority Inversion using Resource Restitution in Real Time Systems.doc 374.5 KB
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> How to make copy of Resource
>
>                   Please see the attachment ...

found in the paper: " A key characteristic of a RTOS is the level of its 
consistency concerning the amount of time it takes to accept and 
complete an application's task 
<http://en.wikipedia.org/wiki/Task_%28computing%29>; "

--->IMHO  ... that's not correct. Speed has nothing to do with 
real-time. A real-time application task has to provide results at the 
requested time ... the so called "dead line".

Also: "but a real-time OS is valued more for how quickly or how 
predictably it can respond than for the amount of work it can perform in 
a given period of time."
---> The amont of work is mainly dependend on the power of the processor 
... a real-time OS can't spent processing cycles :)

The key in scheduling is the "event" orientation ... have also a look to 
the priority inheritance with QNX.

--Armin




> To implement / Stimulate the said concept ..
> 1]i am developing Resource Manager for handling the resource(e.g. serial port)...all resources cannot follow  this
> approach..
> 2]then create client to generate threads of only TWO priorities High and Low...
> 3] the problem is
>
>
> a]How to make copy of Resource
>   (i think using multiple thread RM can handle this but how....)..
>    Please share our views/suggestions...
>
>
> Thank You,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89574
Re: How to make copy of Resource  
Hi Armin ,

       I have studied the Priority Inheritance protocol....
Now, i want to make copies of Resource using Resource Manager....
(now i am taking e.g of serial  port)
so that 
-The system in our approach saves the resource as backup and when a higher priority thread arrives it revokes the low-
priority thread, restores the resource, let the high priority thread executes and later restarts the revoked threads. 
-Although the low-priority threads may have to be revoked several times but the high priority thread is always served 
the best which is a basic requirement in real time systems. 

Multiple Priority Levels
-Here we discuss threads with only two priorities: low and high. However in usual cases systems generally have threads 
with several levels of priorities. If several levels of priorities are used in our system then the lowest level of 
priority will suffer a lot in terms of time delay because each time a higher level thread arrives, the lowest priority 
thread will be preempted and restarted later. 

-This will degrade the overall performance of the system. In order to cope up with this problem we classify the 
different levels of priorities into two categories. These two categories are high and low. The categories may not 
contain equal number of levels of priorities. This is up to the programmer to make levels of priority on design time.
- Since the proposed approach is basically meant for real time system where the high priority threads are given the 
utmost advantage therefore as a tradeoff the low priority threads have to suffer. Hence making classes of priorities 
will prevent complete blocking of lowest priority threads. 




Thank You,
 Atul Kumbhar
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> Hi Armin ,
>
>         I have studied the Priority Inheritance protocol....
> Now, i want to make copies of Resource using Resource Manager....
> (now i am taking e.g of serial  port)

The so called "Resource Manager" is in general an other term of a 
"device driver"  ... it is not a copy utility.

--Armin

> so that
> -The system in our approach saves the resource as backup and when a higher priority thread arrives it revokes the low-
priority thread, restores the resource, let the high priority thread executes and later restarts the revoked threads.
> -Although the low-priority threads may have to be revoked several times but the high priority thread is always served 
the best which is a basic requirement in real time systems.
>
> Multiple Priority Levels
> -Here we discuss threads with only two priorities: low and high. However in usual cases systems generally have threads
 with several levels of priorities. If several levels of priorities are used in our system then the lowest level of 
priority will suffer a lot in terms of time delay because each time a higher level thread arrives, the lowest priority 
thread will be preempted and restarted later.
>
> -This will degrade the overall performance of the system. In order to cope up with this problem we classify the 
different levels of priorities into two categories. These two categories are high and low. The categories may not 
contain equal number of levels of priorities. This is up to the programmer to make levels of priority on design time.
> - Since the proposed approach is basically meant for real time system where the high priority threads are given the 
utmost advantage therefore as a tradeoff the low priority threads have to suffer. Hence making classes of priorities 
will prevent complete blocking of lowest priority threads.
>
>
>
>
> Thank You,
>   Atul Kumbhar
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89633
>
>
Re: How to make copy of Resource  
i want to modifiy the resource Manager(device driver here) for the said approach...
i know its not the copy utility and also all the resource(devices ) cant be copied ....

Regards,
Atul Kumbhar
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> Hi Armin ,
>
>         I have studied the Priority Inheritance protocol....
> Now, i want to make copies of Resource using Resource Manager....
> (now i am taking e.g of serial  port)
> so that
> -The system in our approach saves the resource as backup and when a higher priority thread arrives it revokes the low-
priority thread, restores the resource, let the high priority thread executes and later restarts the revoked threads.
> -Although the low-priority threads may have to be revoked several times but the high priority thread is always served 
the best which is a basic requirement in real time systems.

I don't understand what you are trying to explain.

>
> Multiple Priority Levels
> -Here we discuss threads with only two priorities: low and high. However in usual cases systems generally have threads
 with several levels of priorities. If several levels of priorities are used in our system then the lowest level of 
priority will suffer a lot in terms of time delay because each time a higher level thread arrives, the lowest priority 
thread will be preempted and restarted later.

You mean continued instead of restarted ?

>
> -This will degrade the overall performance of the system.

Why do you see here a degrade of performance?

>   In order to cope up with this problem we classify the different levels of priorities into two categories. These two 
categories are high and low. The categories may not contain equal number of levels of priorities. This is up to the 
programmer to make levels of priority on design time.
> - Since the proposed approach is basically meant for real time system where the high priority threads are given the 
utmost advantage therefore as a tradeoff the low priority threads have to suffer.

You should read about the QNX feature "adaptive partitioning" : 
http://www.qnx.com/developers/docs/6.4.1/adaptive_partitioning_en/bookset.html

Regards

Armin Steinhoff

http://www.steinhoff-automation.com
Re: How to make copy of Resource  
Dear Armin Sir,


Title : "Evasion of Priority Inversion using Resource 
           			           Restitution in Real Time Systems"

Significance: 
•This will eliminate the problem of cascading roll back (which occurs in log based systems). 

• Besides preventing priority inversion this approach prevents multiple-blocking and deadlock (the issues present in 
priority inheritance) as well.

Its IEEE paper was stimulated using Java for Win XP...

I want to implement this project for QNX RTOS which gives a solution for Priority Inversion Problem ... and get the 
performance results either good or bad...
How it works and for which type of resources this approach  is  more feasible 
than present the Priority Inheritance Protocol / or Priority Ceiling Protocol for QNX ... previously attached my project
 synopsis... 
Also , attaching the  IEEE paper which i am implementing .....

plz guide me....

Thanks & Regards,
Atul Kumbhar
Attachment: PDF V3I14.pdf 90.87 KB
Re: How to make copy of Resource  
Hi Atul,

QNX avoids priority inversion.

If you disable priority inheritance for your threads/processes you could 
rebuild the scheduling sandbox as decribed by your paper.

BTW ... resources are critical code sections, semaphores, mutexes a.s.o .

Regards

--Armin

PS: I'm not a "Sir" ... I'm located in Germany :)


Atul Kumbhar wrote:
> Dear Armin Sir,
>
>
> Title : "Evasion of Priority Inversion using Resource
>             			           Restitution in Real Time Systems"
>
> Significance:
> •This will eliminate the problem of cascading roll back (which occurs in log based systems).
>
> • Besides preventing priority inversion this approach prevents multiple-blocking and deadlock (the issues present
 in priority inheritance) as well.
>
> Its IEEE paper was stimulated using Java for Win XP...
>
> I want to implement this project for QNX RTOS which gives a solution for Priority Inversion Problem ... and get the 
performance results either good or bad...
> How it works and for which type of resources this approach  is  more feasible
> than present the Priority Inheritance Protocol / or Priority Ceiling Protocol for QNX ... previously attached my 
project synopsis...
> Also , attaching the  IEEE paper which i am implementing .....
>
> plz guide me....
>
> Thanks&  Regards,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89641
Re: How to make copy of Resource  
I read some section of the documents ( this is border line consulting services).   At first glance I'd say the idea is 
flawed.  A critical section is called a critical section because it's critical.  Trying to make it uncritical by making 
a "backup" of the critical section data doesn't make any kind of sense to me. As far as I am concern the solution is to 
get rid of the critical section ;-)  Or at least make it as small as possible.  But that is probably not what you want 
to hear.

About implementing this in a resource manager, as you asked:  I don't think that is possible. I mean for the backup "
procedure" to occurs you have to know what to backup and you can't.  Take for example a file descriptor, it's just a 
number.  There is no way to backup the internal data related to the file descriptor as it's private to the C library.  
Even if you could backup it up, when it would get restore chaos would most probably ensue.




Re: How to make copy of Resource  
@Mario Sir & Armin Sir-

first i will like to say thank you for border line consulting services :) ....
And also, i will prefer to say Sir as both of u are elder to me ... 
n i am from INDIA :)

Yes, resources include critical code sections, semaphores, mutexes , porst,etc..
i have taken reource   say serial port using resource manager(RM) because 
1] i think its easy as u can write driver/RM for serial port..
2] dont have access to process manager nor i can get its codes ,since i m student a non-commercial user... :(

hence, using RM instead for going directly  to  critical code sections, semaphores, mutexes. 

3] Also, this approach wont be feasible for all sort of resource & Applications ...
    so finding out  resources or apps for which this will work is another work...:)
    
 @Mario Sir - 

about restoring if low priority thread uses it ..resource will be the one which is modified/used by low priority thread.
.else if High priority thread interrrupts... the resource one which is modified/used by High priority thread (i.e backed
 resource)..

it will be helpful for me if anyone can provide me the access to Process Manager and Memory Manager source code...i 
tried but not accessible to students...

 Thanks&  Regards,
 Atul Kumbhar
http://about.me/atulkumbhar

Re: How to make copy of Resource  
Atul,

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 get wrong.
Yes. That's why QNX implemented them very carefully for you, at the very heart of the OS.


In short, I believe you are bound to shoot yourself in the foot with this project quite badly - but that's just my 
personal opinion.

- Thomas

___

Text sources:
   [RED] : http://en.wikipedia.org/wiki/Real-time_operating_system
[YELLOW] : http://www.tmrfindia.org/ijcsa/V3I14.pdf
 [GREEN] : http://embeddedgurus.com/barr-code/2010/11/firmware-specific-bug-8-priority-inversion/

___

Disclaimer: 
 The statements and opinions in this message are my personal ones, 
 not those of my employer or any organization I am a member of.
Attachment: Word Evasion.doc 375.5 KB
Re: How to make copy of Resource  
Thomas Haupt wrote:
> Atul,
>
> 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.
>
[ clip]
>
>
> In short, I believe you are bound to shoot yourself in the foot with this project quite badly - but that's just my 
personal opinion.

IMHO .... someone did misinterpret the concepts of the RCUs: 
http://www.rdrop.com/users/paulmck/RCU/whatisRCU.html

--Armin



>
> - Thomas
>
> ___
>
> Text sources:
>     [RED] : http://en.wikipedia.org/wiki/Real-time_operating_system
> [YELLOW] : http://www.tmrfindia.org/ijcsa/V3I14.pdf
>   [GREEN] : http://embeddedgurus.com/barr-code/2010/11/firmware-specific-bug-8-priority-inversion/
>
> ___
>
> Disclaimer:
>   The statements and opinions in this message are my personal ones,
>   not those of my employer or any organization I am a member of.
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89669
RE: How to make copy of Resource  
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? 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
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
>
>
RE: How to make copy of Resource  
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 and the time to restore 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.

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. 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."

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."
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: RE: How to make copy of Resource  
@Thomas sir & Arim Sir 

i know that your  intention is not to bash on my project , n i am taking your veiws positively ...:) 
 it seems that this  Resource Restitution not going to help for QNX rather from its implementation ...but i have to prove this programatically means i have to  implement/stimulate it somehow ... then prepare stats for all the  aspects which you and Mr.Arim  sir  are saying...

 @Arim Sir


What happens if two threads of the low priority group running at 
different priorities are trying to update the resource ? Synchronization?

-> they suggested to make TWO classess of  HIGH and LOW priority threads only ..and for QNX 
 255 priorities...


need modifications in approach itself....but i have to complete this project as i have  already submitted the synopsis :
)  



I am grateful for your views in depth stating  pros and cons....mostly cons :)



Thanks & regards,
Atul Kumbhar 
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> @Thomas sir&  Arim Sir
>
> i know that your  intention is not to bash on my project , n i am taking your veiws positively ...:)
>   it seems that this  Resource Restitution not going to help for QNX rather from its implementation ...but i have to 
prove this programatically means i have to  implement/stimulate it somehow ... then prepare stats for all the  aspects 
which you and Mr.Arim  sir  are saying...
>
>   @Arim Sir
>
>
> What happens if two threads of the low priority group running at
> different priorities are trying to update the resource ? Synchronization?
>
> ->  they suggested to make TWO classess of  HIGH and LOW priority threads only ..and for QNX
>   255 priorities...

For instance: the thread with the highest prio runs at e.g. 254 ... and 
the threads of the low prio group at  200, 199, 198,197 a.s.o ... and 
all members of the low prio group want also to use the same resource.
What about the handling of the concurrent access within the low prio group?

> need modifications in approach itself....but i have to complete this project as i have  already submitted the synopsis
 :)

IMHO ... you have to do the following steps (for one low and high prior 
thread):

- the low prio threads have to find out if they were prempted or not ... 
latest at their termination. ( version count at the resource (memory?) )
-  if a low prio thread was prempted it must be terminated and restarted 
( after creating a new resource shadow)

- the high prio thread simply preempts the low prio thread
- in order to be consistent with the RCU concept you don't have to use 
locks (semaphores, mutexes ..)

--Armin


>
>
>
>
> I am grateful for your views in depth stating  pros and cons....mostly cons :)
>
>
>
> Thanks&  regards,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89729
>
>
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> @Thomas sir&  Arim Sir
>
> i know that your  intention is not to bash on my project , n i am taking your veiws positively ...:)
>   it seems that this  Resource Restitution not going to help for QNX rather from its implementation ...but i have to 
prove this programatically means i have to  implement/stimulate it somehow ... then prepare stats for all the  aspects 
which you and Mr.Arim  sir  are saying...
>
>   @Arim Sir
>
>
> What happens if two threads of the low priority group running at
> different priorities are trying to update the resource ? Synchronization?
>
> ->  they suggested to make TWO classess of  HIGH and LOW priority threads only ..and for QNX
>   255 priorities...

For instance: the thread with the highest prio runs at e.g. 254 ... and 
the threads of the low prio group at  200, 199, 198,197 a.s.o ... and 
all members of the low prio group want also to use the same resource.
What about the handling of the concurrent access within the low prio group?

> need modifications in approach itself....but i have to complete this project as i have  already submitted the synopsis
 :)

IMHO ... you have to do the following steps (for one low and high prior 
thread):

- the low prio threads have to find out if they were prempted or not ... 
latest at their termination. ( version count at the resource (memory?) )
-  if a low prio thread was prempted it must be terminated and restarted 
( after creating a new resource shadow)

- the high prio thread simply preempts the low prio thread
- in order to be consistent with the RCU concept you don't have to use 
locks (semaphores, mutexes ..)

--Armin


>
>
>
>
> I am grateful for your views in depth stating  pros and cons....mostly cons :)
>
>
>
> Thanks&  regards,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89729
>
>
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> @Thomas sir&  Arim Sir
>
> i know that your  intention is not to bash on my project , n i am taking your veiws positively ...:)
>   it seems that this  Resource Restitution not going to help for QNX rather from its implementation ...but i have to 
prove this programatically means i have to  implement/stimulate it somehow ... then prepare stats for all the  aspects 
which you and Mr.Arim  sir  are saying...
>
>   @Arim Sir
>
>
> What happens if two threads of the low priority group running at
> different priorities are trying to update the resource ? Synchronization?
>
> ->  they suggested to make TWO classess of  HIGH and LOW priority threads only ..and for QNX
>   255 priorities...

For instance: the thread with the highest prio runs at e.g. 254 ... and 
the threads of the low prio group at  200, 199, 198,197 a.s.o ... and 
all members of the low prio group want also to use the same resource.
What about the handling of the concurrent access within the low prio group?

> need modifications in approach itself....but i have to complete this project as i have  already submitted the synopsis
 :)

IMHO ... you have to do the following steps (for one low and high prior 
thread):

- the low prio threads have to find out if they were prempted or not ... 
latest at their termination. ( version count at the resource (memory?) )
-  if a low prio thread was prempted it must be terminated and restarted 
( after creating a new resource shadow)

- the high prio thread simply preempts the low prio thread
- in order to be consistent with the RCU concept you don't have to use 
locks (semaphores, mutexes ..)

--Armin


>
>
>
>
> I am grateful for your views in depth stating  pros and cons....mostly cons :)
>
>
>
> Thanks&  regards,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89729
>
>
Re: How to make copy of Resource  
Atul Kumbhar wrote:
> @Thomas sir&  Arim Sir
>
> i know that your  intention is not to bash on my project , n i am taking your veiws positively ...:)
>   it seems that this  Resource Restitution not going to help for QNX rather from its implementation ...but i have to 
prove this programatically means i have to  implement/stimulate it somehow ... then prepare stats for all the  aspects 
which you and Mr.Arim  sir  are saying...
>
>   @Arim Sir
>
>
> What happens if two threads of the low priority group running at
> different priorities are trying to update the resource ? Synchronization?
>
> ->  they suggested to make TWO classess of  HIGH and LOW priority threads only ..and for QNX
>   255 priorities...

For instance: the thread with the highest prio runs at e.g. 254 ... and 
the threads of the low prio group at  200, 199, 198,197 a.s.o ... and 
all members of the low prio group want also to use the same resource.
What about the handling of the concurrent access within the low prio group?

> need modifications in approach itself....but i have to complete this project as i have  already submitted the synopsis
 :)

IMHO ... you have to do the following steps (for one low and high prior 
thread):

- the low prio threads have to find out if they were prempted or not ... 
latest at their termination. ( version count at the resource (memory?) )
-  if a low prio thread was prempted it must be terminated and restarted 
( after creating a new resource shadow)

- the high prio thread simply preempts the low prio thread
- in order to be consistent with the RCU concept you don't have to use 
locks (semaphores, mutexes ..)

--Armin


>
>
>
>
> I am grateful for your views in depth stating  pros and cons....mostly cons :)
>
>
>
> Thanks&  regards,
> Atul Kumbhar
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89729
>
>
Re: How to make copy of Resource  
> >   @Arim Sir
> >
> >
> > What happens if two threads of the low priority group running at
> > different priorities are trying to update the resource ? Synchronization?
> >
> > ->  they suggested to make TWO classess of  HIGH and LOW priority threads 
> only ..and for QNX
> >   255 priorities...
> 
> For instance: the thread with the highest prio runs at e.g. 254 ... and 
> the threads of the low prio group at  200, 199, 198,197 a.s.o ... and 
> all members of the low prio group want also to use the same resource.
> What about the handling of the concurrent access within the low prio group?
> 
> > need modifications in approach itself....but i have to complete this project
>  as i have  already submitted the synopsis :)
> 
> IMHO ... you have to do the following steps (for one low and high prior 
> thread):
> 
> - the low prio threads have to find out if they were prempted or not ... 
> latest at their termination. ( version count at the resource (memory?) )


@@.. what is version count  at the resource(memory)..i didnt got this point....
will u plz elabotare...



> -  if a low prio thread was prempted it must be terminated and restarted 
> ( after creating a new resource shadow)
> 
> - the high prio thread simply preempts the low prio thread
> - in order to be consistent with the RCU concept you don't have to use 
> locks (semaphores, mutexes ..)
> 
> --Armin
> > >
> > I am grateful for your views in depth stating  pros and cons....mostly cons 
> :)
> >
> >

@ Thomas Sir & Armin Sir

i need your profiles for acknowledgement  in  project report...if u dont mind.  u can send it on  atulkumbhar@aol.in


 Thanks &  regards,
 Atul Kumbhar




Re: How to make copy of Resource  
Atul Kumbhar wrote:
> { clip]
>
> @@.. what is version count  at the resource(memory)..i didnt got this point....
> will u plz elabotare...

For instance: a memory object could include a field which stores the 
version of the object.
This version field must be incremented after an update.
If a low priority thread has been prempted by a high priority thread the 
version of the shadowed object
is then different to the current version of the object.

IMHO ... your algorithm could be easily tested with memory objects or 
named memory objects.

--Armin

Re: How to make copy of Resource  
Hey Armin - did you fall asleep on the "send" button?   ;-)
Re: How to make copy of Resource  
Thomas Haupt wrote:
> Hey Armin - did you fall asleep on the "send" button?   ;-)

No ... I got the impression that at least 3 postings went into the void.
The mail sever was in a sleep mode ...

--Armin


>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post89760
>
>
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
>
>
>
>
>...