Pth Scheduling Policy

2004-10-13 Thread Vinu V



Hi,

I have some doubts 
regarding the way in which the Pth scheduler implements"Priority 
basednon-preemptive Scheduling".

My program is 
using the pth "cond" and "mutex" variables for synchronization between the 
threads.

From a low priority thread, I am calling 
pth_cond_notify() and immediately a higher priority thread (which was there in 
the ready queue) was getting scheduled.
I analyzed the pth_cond_notify () and saw a 
pth_yield() inside that function. This 
pth_yield() is "preempting" the lower priority thread that called the 
pth_cond_notify().
But my application was expecting a pure 
non-preemptive response. 
Can I achieve the non-preemptive response if 
Iremovethe pth_yield() in 
pth_cond_notify() ?
Will there be any performance issue with the Pth 
library, if I remove the pth_yield () in pth_cond_notify() ?

Regards
Vinu 

-
Disclaimer
-

This message(including attachment if any)is confidential and may be privileged.Before 
opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not be 
responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If you have 
received this message by mistake please notify the sender by return  e-mail and delete 
this message from your system. Any unauthorized use or dissemination of this message 
in whole or in part is strictly prohibited.  Please note that e-mails are susceptible 
to change and MindTree shall not be liable for any improper, untimely or incomplete 
transmission.

-

RE: Pth Scheduling Policy

2004-10-13 Thread Vinu V



 My program is using the pth cond and mutex
 variables for synchronization between the threads.
 From a low priority thread, I am calling
 pth_cond_notify() and immediately a higher priority
 thread (which was there in the ready queue) was getting scheduled.

Well, that's the purpose of 'pth_cond_notify'. It is, after all, a
synchronization function.

I think in a non preemptive system, the library cannot force the
application to 
yield the CPU unless the application by itself does an yield.

Using pth_cond_notify, a thread just wants to notify another thread
that,
an event has occurred and it doesn't mean that it should also relinquish the
CPU.
Its upto that thread whether to continue with the processing or not.

Is there any other call in Pth which can be used for sending a
notification
to a thread, without relinquishing the CPU ?


Regards,
Vinu 



-
Disclaimer
-

This message(including attachment if any)is confidential and may be privileged.Before 
opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not be 
responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If you have 
received this message by mistake please notify the sender by return  e-mail and delete 
this message from your system. Any unauthorized use or dissemination of this message 
in whole or in part is strictly prohibited.  Please note that e-mails are susceptible 
to change and MindTree shall not be liable for any improper, untimely or incomplete 
transmission.

-

Timer Implementation in Pth

2004-06-22 Thread Vinu V

Hi,

My requirement is to have a timer implementation using Pth library.

The call shown below causes the callback func to be called at the specified
timeout:
-
---
main_func()
{
pth_ev = pth_event(PTH_EVENT_FUNC, func, NULL, pth_timeout(0,
50));
pth_wait(pth_ev); /* Thread waits here . it is signalled from
callback - func*/
}

However, the execution of the main_func thread is blocked until it is
signalled which happens when the callback is called.

int func(void * arg)
{
/* In timer callback */
}

I need to have a timer implementation similar to timer_init, timer_add,
timer_settime etcwhere the caller does not get blocked.
Is there a way of doing the same using Pth.?

Kind Regards,
Bhanu Kurpad






DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. 
Before opening attachments please check them for viruses and defects. MindTree 
Consulting Private Limited (MindTree) will not be responsible for any viruses or 
defects or any forwarded attachments emanating either from within MindTree or outside. 
If you have received this message by mistake please notify the sender by return  
e-mail and delete this message from your system. Any unauthorized use or dissemination 
of this message in whole or in part is strictly prohibited.  Please note that e-mails 
are susceptible to change and MindTree shall not be liable for any improper, untimely 
or incomplete transmission.
__
GNU Portable Threads (Pth)http://www.gnu.org/software/pth/
Development Site  http://www.ossp.org/pkg/lib/pth/
Distribution Files  ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager (Majordomo)   [EMAIL PROTECTED]


Kernel - Pth Thread Communication.

2004-06-21 Thread Vinu V



Hi,

I am using Pth 
threads in the user space.
I need to make one 
Pth thread waiting for a kernel event to occur. 
Could someone 
suggest me the best methods for implementing this ?

Thanks  
Regards
Vinu 



DISCLAIMER:This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return  e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited.  Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.