Fraser Moore
|
TimerTimeout() not getting timeout
|
Fraser Moore
08/09/2012 4:27 AM
post94708
|
TimerTimeout() not getting timeout
Hi,
I'm trying to use TimerTimeout() to check for timeouts before calling
devctl(), i.e.
timeout = 1000000000;
ret = TimerTimeout( CLOCK_REALTIME,
_NTO_TIMEOUT_SEND |
_NTO_TIMEOUT_REPLY,
NULL, &timeout, NULL);
ret = devctl( fd, dcmd, ipcMsg,
IPC_MESSAGE_SIZE( ipcMsg->dataLength ), NULL);
If I set timeout to 0 then I always get a timeout with devctl()
returning ETIMEDOUT as expected. But if I set it to any other non-zero
value then I never get the timeout event.
I'm building for the x86 platform and running it on a VMWare VM. I'm
not sure if I'm doing something wrong, or there is an issue with the
timeouts on this platform.
Any help much appreciated.
Fraser
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South,
Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
|
|
|
Gervais Mulongoy
|
Re: TimerTimeout() not getting timeout
|
Gervais Mulongoy
08/09/2012 7:07 AM
post94710
|
Re: TimerTimeout() not getting timeout
Try setting an unblock event instead of NULL:
SIGEV_UNBLOCK_INIT(&ev);
|
|
|
Fraser Moore
|
Re: TimerTimeout() not getting timeout
|
Fraser Moore
08/09/2012 9:30 AM
post94714
|
Re: TimerTimeout() not getting timeout
Thanks for the reply. I had tried this but got the same results.
On 09/08/2012 12:05, Gervais Mulongoy wrote:
> Try setting an unblock event instead of NULL:
>
> SIGEV_UNBLOCK_INIT(&ev);
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94710
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South,
Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
|
|
|
Thomas Haupt
|
RE: TimerTimeout() not getting timeout
|
Thomas Haupt
08/09/2012 9:29 AM
post94715
|
RE: TimerTimeout() not getting timeout
What resource manager is this devctl going to?
- Thomas
-----Original Message-----
From: Fraser Moore [mailto:community-noreply@qnx.com]
Sent: Donnerstag, 9. August 2012 15:27
To: ostech-core_os@community.qnx.com
Subject: Re: TimerTimeout() not getting timeout
Thanks for the reply. I had tried this but got the same results.
On 09/08/2012 12:05, Gervais Mulongoy wrote:
> Try setting an unblock event instead of NULL:
>
> SIGEV_UNBLOCK_INIT(&ev);
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94710
> To cancel your subscription to this discussion, please e-mail
> ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post94714
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
Fraser Moore
|
Re: TimerTimeout() not getting timeout
|
Fraser Moore
08/09/2012 9:42 AM
post94716
|
Re: TimerTimeout() not getting timeout
It is one that we have developed.
On 09/08/2012 14:28, Thomas Haupt wrote:
> What resource manager is this devctl going to?
>
> - Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Donnerstag, 9. August 2012 15:27
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> Thanks for the reply. I had tried this but got the same results.
>
> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>> Try setting an unblock event instead of NULL:
>>
>> SIGEV_UNBLOCK_INIT(&ev);
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94710
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>
> --
> Fraser Moore
> Abelon Systems Ltd
> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
> phone: 0131 449 9173 web: www.abelon.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94714
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94715
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South,
Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
|
|
|
Thomas Haupt
|
RE: TimerTimeout() not getting timeout
|
Thomas Haupt
08/09/2012 9:47 AM
post94717
|
RE: TimerTimeout() not getting timeout
Does it do proper unblock handling?
-----Original Message-----
From: Fraser Moore [mailto:community-noreply@qnx.com]
Sent: Donnerstag, 9. August 2012 15:40
To: ostech-core_os@community.qnx.com
Subject: Re: TimerTimeout() not getting timeout
It is one that we have developed.
On 09/08/2012 14:28, Thomas Haupt wrote:
> What resource manager is this devctl going to?
>
> - Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Donnerstag, 9. August 2012 15:27
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> Thanks for the reply. I had tried this but got the same results.
>
> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>> Try setting an unblock event instead of NULL:
>>
>> SIGEV_UNBLOCK_INIT(&ev);
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94710
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>
> --
> Fraser Moore
> Abelon Systems Ltd
> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
> phone: 0131 449 9173 web: www.abelon.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94714
> To cancel your subscription to this discussion, please e-mail
> ostech-core_os-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94715
> To cancel your subscription to this discussion, please e-mail
> ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post94716
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
Lichun Zhu
|
RE: TimerTimeout() not getting timeout
|
Lichun Zhu
08/09/2012 9:55 AM
post94718
|
RE: TimerTimeout() not getting timeout
I think this is it, the resmgr did not handle unblock.
-----Original Message-----
From: Thomas Haupt [mailto:community-noreply@qnx.com]
Sent: Thursday, August 09, 2012 9:44 AM
To: 'ostech-core_os@community.qnx.com'
Subject: RE: TimerTimeout() not getting timeout
Does it do proper unblock handling?
-----Original Message-----
From: Fraser Moore [mailto:community-noreply@qnx.com]
Sent: Donnerstag, 9. August 2012 15:40
To: ostech-core_os@community.qnx.com
Subject: Re: TimerTimeout() not getting timeout
It is one that we have developed.
On 09/08/2012 14:28, Thomas Haupt wrote:
> What resource manager is this devctl going to?
>
> - Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Donnerstag, 9. August 2012 15:27
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> Thanks for the reply. I had tried this but got the same results.
>
> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>> Try setting an unblock event instead of NULL:
>>
>> SIGEV_UNBLOCK_INIT(&ev);
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94710
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>
> --
> Fraser Moore
> Abelon Systems Ltd
> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
> phone: 0131 449 9173 web: www.abelon.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94714
> To cancel your subscription to this discussion, please e-mail
> ostech-core_os-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94715
> To cancel your subscription to this discussion, please e-mail
> ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone: 0131 449 9173 web: www.abelon.com
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post94716
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post94717
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
Fraser Moore
|
Re: TimerTimeout() not getting timeout
|
Fraser Moore
08/10/2012 3:47 AM
post94741
|
Re: TimerTimeout() not getting timeout
I tried defining my own io_unblock that simply calls
iofunc_unblock_default(). However I never see this function getting
called by the resource manager. I am new to writing resource managers
so what should I be doing to handle unblocks?
cheers,
fraser
On 09/08/2012 14:52, Lichun Zhu wrote:
> I think this is it, the resmgr did not handle unblock.
>
> -----Original Message-----
> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> Sent: Thursday, August 09, 2012 9:44 AM
> To: 'ostech-core_os@community.qnx.com'
> Subject: RE: TimerTimeout() not getting timeout
>
> Does it do proper unblock handling?
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Donnerstag, 9. August 2012 15:40
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> It is one that we have developed.
>
> On 09/08/2012 14:28, Thomas Haupt wrote:
>> What resource manager is this devctl going to?
>>
>> - Thomas
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Donnerstag, 9. August 2012 15:27
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> Thanks for the reply. I had tried this but got the same results.
>>
>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>> Try setting an unblock event instead of NULL:
>>>
>>> SIGEV_UNBLOCK_INIT(&ev);
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> OSTech
>>> http://community.qnx.com/sf/go/post94710
>>> To cancel your subscription to this discussion, please e-mail
>>> ostech-core_os-unsubscribe@community.qnx.com
>>>
>>
>> --
>> Fraser Moore
>> Abelon Systems Ltd
>> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
>> phone: 0131 449 9173 web: www.abelon.com
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94714
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94715
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>
> --
> Fraser Moore
> Abelon Systems Ltd
> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
> phone: 0131 449 9173 web: www.abelon.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94716
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94717
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post94718
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
>
--
Fraser Moore
Abelon Systems Ltd
Building 4, Quantum Court, Research Avenue South,
Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
phone:...
|
|
|
Thomas Haupt
|
RE: TimerTimeout() not getting timeout
|
Thomas Haupt
08/10/2012 4:29 AM
post94743
|
RE: TimerTimeout() not getting timeout
The io_unblock callout will only be invoked when you get back to your resource manager's main loop (dispatch_block() /
dispatch_handle()) somehow.
If you are handling the devctl in some way such that the resource manager will still be in io_devctl() when the timeout
comes, no unblock handling will be done.
In order for unblocking to work properly, you need to somehow put "long" (potentially blocking) tasks into the "
background" and return to the main message handler loop. That could mean doing them in a separate thread, or adding
entries on an "outstanding tasks" list that you can look into when you see a state change (e.g., an interrupt signaling
data coming in).
Regards,
Thomas
-----Original Message-----
From: Fraser Moore [mailto:community-noreply@qnx.com]
Sent: Freitag, 10. August 2012 09:44
To: ostech-core_os@community.qnx.com
Subject: Re: TimerTimeout() not getting timeout
I tried defining my own io_unblock that simply calls iofunc_unblock_default(). However I never see this function
getting called by the resource manager. I am new to writing resource managers so what should I be doing to handle
unblocks?
cheers,
fraser
On 09/08/2012 14:52, Lichun Zhu wrote:
> I think this is it, the resmgr did not handle unblock.
>
> -----Original Message-----
> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> Sent: Thursday, August 09, 2012 9:44 AM
> To: 'ostech-core_os@community.qnx.com'
> Subject: RE: TimerTimeout() not getting timeout
>
> Does it do proper unblock handling?
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Donnerstag, 9. August 2012 15:40
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> It is one that we have developed.
>
> On 09/08/2012 14:28, Thomas Haupt wrote:
>> What resource manager is this devctl going to?
>>
>> - Thomas
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Donnerstag, 9. August 2012 15:27
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> Thanks for the reply. I had tried this but got the same results.
>>
>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>> Try setting an unblock event instead of NULL:
>>>
>>> SIGEV_UNBLOCK_INIT(&ev);
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> OSTech
>>> http://community.qnx.com/sf/go/post94710
>>> To cancel your subscription to this discussion, please e-mail
>>> ostech-core_os-unsubscribe@community.qnx.com
>>>
>>
>> --
>> Fraser Moore
>> Abelon Systems Ltd
>> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
>> phone: 0131 449 9173 web: www.abelon.com
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94714
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>>
>>
>>
>> _______________________________________________
>>
>> OSTech
>> http://community.qnx.com/sf/go/post94715
>> To cancel your subscription to this discussion, please e-mail
>> ostech-core_os-unsubscribe@community.qnx.com
>>
>
> --
> Fraser Moore
> Abelon Systems Ltd
> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
> phone: 0131 449 9173 web:...
View Full Message
|
|
|
Fraser Moore
|
Re: TimerTimeout() not getting timeout
|
Fraser Moore
08/10/2012 4:39 AM
post94744
|
Re: TimerTimeout() not getting timeout
Hi Thomas, I think that's exactly what's happening. I had just been
reading the about this in the documentation. I will try and create a
new thread to handle this.
I may be back for more advice.
Thanks,
Fraser
On 10/08/2012 09:25, Thomas Haupt wrote:
> The io_unblock callout will only be invoked when you get back to your resource manager's main loop (dispatch_block() /
dispatch_handle()) somehow.
>
> If you are handling the devctl in some way such that the resource manager will still be in io_devctl() when the
timeout comes, no unblock handling will be done.
>
> In order for unblocking to work properly, you need to somehow put "long" (potentially blocking) tasks into the "
background" and return to the main message handler loop. That could mean doing them in a separate thread, or adding
entries on an "outstanding tasks" list that you can look into when you see a state change (e.g., an interrupt signaling
data coming in).
>
> Regards,
> Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Freitag, 10. August 2012 09:44
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> I tried defining my own io_unblock that simply calls iofunc_unblock_default(). However I never see this function
getting called by the resource manager. I am new to writing resource managers so what should I be doing to handle
unblocks?
>
> cheers,
> fraser
>
> On 09/08/2012 14:52, Lichun Zhu wrote:
>> I think this is it, the resmgr did not handle unblock.
>>
>> -----Original Message-----
>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
>> Sent: Thursday, August 09, 2012 9:44 AM
>> To: 'ostech-core_os@community.qnx.com'
>> Subject: RE: TimerTimeout() not getting timeout
>>
>> Does it do proper unblock handling?
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Donnerstag, 9. August 2012 15:40
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> It is one that we have developed.
>>
>> On 09/08/2012 14:28, Thomas Haupt wrote:
>>> What resource manager is this devctl going to?
>>>
>>> - Thomas
>>>
>>> -----Original Message-----
>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>> Sent: Donnerstag, 9. August 2012 15:27
>>> To: ostech-core_os@community.qnx.com
>>> Subject: Re: TimerTimeout() not getting timeout
>>>
>>> Thanks for the reply. I had tried this but got the same results.
>>>
>>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>>> Try setting an unblock event instead of NULL:
>>>>
>>>> SIGEV_UNBLOCK_INIT(&ev);
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> OSTech
>>>> http://community.qnx.com/sf/go/post94710
>>>> To cancel your subscription to this discussion, please e-mail
>>>> ostech-core_os-unsubscribe@community.qnx.com
>>>>
>>>
>>> --
>>> Fraser Moore
>>> Abelon Systems Ltd
>>> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
>>> phone: 0131 449 9173 web: www.abelon.com
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> OSTech
>>> http://community.qnx.com/sf/go/post94714
>>> To cancel your subscription to this discussion, please e-mail
>>>...
View Full Message
|
|
|
Thomas Haupt
|
RE: TimerTimeout() not getting timeout
|
Thomas Haupt
08/10/2012 5:43 AM
post94745
|
RE: TimerTimeout() not getting timeout
Hi Fraser,
sure, feel free.
Cheers,
Thomas
-----Original Message-----
From: Fraser Moore [mailto:community-noreply@qnx.com]
Sent: Freitag, 10. August 2012 10:37
To: ostech-core_os@community.qnx.com
Subject: Re: TimerTimeout() not getting timeout
Hi Thomas, I think that's exactly what's happening. I had just been reading the about this in the documentation. I
will try and create a new thread to handle this.
I may be back for more advice.
Thanks,
Fraser
On 10/08/2012 09:25, Thomas Haupt wrote:
> The io_unblock callout will only be invoked when you get back to your resource manager's main loop (dispatch_block() /
dispatch_handle()) somehow.
>
> If you are handling the devctl in some way such that the resource manager will still be in io_devctl() when the
timeout comes, no unblock handling will be done.
>
> In order for unblocking to work properly, you need to somehow put "long" (potentially blocking) tasks into the "
background" and return to the main message handler loop. That could mean doing them in a separate thread, or adding
entries on an "outstanding tasks" list that you can look into when you see a state change (e.g., an interrupt signaling
data coming in).
>
> Regards,
> Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Freitag, 10. August 2012 09:44
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> I tried defining my own io_unblock that simply calls iofunc_unblock_default(). However I never see this function
getting called by the resource manager. I am new to writing resource managers so what should I be doing to handle
unblocks?
>
> cheers,
> fraser
>
> On 09/08/2012 14:52, Lichun Zhu wrote:
>> I think this is it, the resmgr did not handle unblock.
>>
>> -----Original Message-----
>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
>> Sent: Thursday, August 09, 2012 9:44 AM
>> To: 'ostech-core_os@community.qnx.com'
>> Subject: RE: TimerTimeout() not getting timeout
>>
>> Does it do proper unblock handling?
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Donnerstag, 9. August 2012 15:40
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> It is one that we have developed.
>>
>> On 09/08/2012 14:28, Thomas Haupt wrote:
>>> What resource manager is this devctl going to?
>>>
>>> - Thomas
>>>
>>> -----Original Message-----
>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>> Sent: Donnerstag, 9. August 2012 15:27
>>> To: ostech-core_os@community.qnx.com
>>> Subject: Re: TimerTimeout() not getting timeout
>>>
>>> Thanks for the reply. I had tried this but got the same results.
>>>
>>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>>> Try setting an unblock event instead of NULL:
>>>>
>>>> SIGEV_UNBLOCK_INIT(&ev);
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> OSTech
>>>> http://community.qnx.com/sf/go/post94710
>>>> To cancel your subscription to this discussion, please e-mail
>>>> ostech-core_os-unsubscribe@community.qnx.com
>>>>
>>>
>>> --
>>> Fraser Moore
>>> Abelon Systems Ltd
>>> Building 4, Quantum Court, Research Avenue South, Heriot Watt Research Park, Riccarton, Edinburgh EH14 4AP.
>>> phone: 0131 449 9173 web:...
View Full Message
|
|
|
Fraser Moore
|
Re: TimerTimeout() not getting timeout
|
Fraser Moore
08/10/2012 10:43 AM
post94751
|
Re: TimerTimeout() not getting timeout
I can now get io_unblock to be called from a separate thread but how do
I then reply to the client which is blocked on another thread to unblock it?
cheers,
fraser
On 10/08/2012 10:43, Thomas Haupt wrote:
> Hi Fraser,
>
> sure, feel free.
>
> Cheers,
> Thomas
>
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: Freitag, 10. August 2012 10:37
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> Hi Thomas, I think that's exactly what's happening. I had just been reading the about this in the documentation. I
will try and create a new thread to handle this.
>
> I may be back for more advice.
>
> Thanks,
> Fraser
>
> On 10/08/2012 09:25, Thomas Haupt wrote:
>> The io_unblock callout will only be invoked when you get back to your resource manager's main loop (dispatch_block()
/ dispatch_handle()) somehow.
>>
>> If you are handling the devctl in some way such that the resource manager will still be in io_devctl() when the
timeout comes, no unblock handling will be done.
>>
>> In order for unblocking to work properly, you need to somehow put "long" (potentially blocking) tasks into the "
background" and return to the main message handler loop. That could mean doing them in a separate thread, or adding
entries on an "outstanding tasks" list that you can look into when you see a state change (e.g., an interrupt signaling
data coming in).
>>
>> Regards,
>> Thomas
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Freitag, 10. August 2012 09:44
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> I tried defining my own io_unblock that simply calls iofunc_unblock_default(). However I never see this function
getting called by the resource manager. I am new to writing resource managers so what should I be doing to handle
unblocks?
>>
>> cheers,
>> fraser
>>
>> On 09/08/2012 14:52, Lichun Zhu wrote:
>>> I think this is it, the resmgr did not handle unblock.
>>>
>>> -----Original Message-----
>>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
>>> Sent: Thursday, August 09, 2012 9:44 AM
>>> To: 'ostech-core_os@community.qnx.com'
>>> Subject: RE: TimerTimeout() not getting timeout
>>>
>>> Does it do proper unblock handling?
>>>
>>> -----Original Message-----
>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>> Sent: Donnerstag, 9. August 2012 15:40
>>> To: ostech-core_os@community.qnx.com
>>> Subject: Re: TimerTimeout() not getting timeout
>>>
>>> It is one that we have developed.
>>>
>>> On 09/08/2012 14:28, Thomas Haupt wrote:
>>>> What resource manager is this devctl going to?
>>>>
>>>> - Thomas
>>>>
>>>> -----Original Message-----
>>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>>> Sent: Donnerstag, 9. August 2012 15:27
>>>> To: ostech-core_os@community.qnx.com
>>>> Subject: Re: TimerTimeout() not getting timeout
>>>>
>>>> Thanks for the reply. I had tried this but got the same results.
>>>>
>>>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>>>> Try setting an unblock event instead of NULL:
>>>>>
>>>>> SIGEV_UNBLOCK_INIT(&ev);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>...
View Full Message
|
|
|
David Sarrazin
|
RE: TimerTimeout() not getting timeout
|
David Sarrazin
08/10/2012 10:41 AM
post94752
|
RE: TimerTimeout() not getting timeout
Simplest way to is to MsgError(ctp->rcvid), which will unblock the client. It's then very important for your resource
manager to keep track of the fact that it has already replied, and either abort the current operation, or simply skip
over the MsgReply that happens when the devctl thread finishes.
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: August-10-12 10:39 AM
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> I can now get io_unblock to be called from a separate thread but how do I
> then reply to the client which is blocked on another thread to unblock it?
>
> cheers,
> fraser
>
> On 10/08/2012 10:43, Thomas Haupt wrote:
> > Hi Fraser,
> >
> > sure, feel free.
> >
> > Cheers,
> > Thomas
> >
> > -----Original Message-----
> > From: Fraser Moore [mailto:community-noreply@qnx.com]
> > Sent: Freitag, 10. August 2012 10:37
> > To: ostech-core_os@community.qnx.com
> > Subject: Re: TimerTimeout() not getting timeout
> >
> > Hi Thomas, I think that's exactly what's happening. I had just been reading
> the about this in the documentation. I will try and create a new thread to
> handle this.
> >
> > I may be back for more advice.
> >
> > Thanks,
> > Fraser
> >
> > On 10/08/2012 09:25, Thomas Haupt wrote:
> >> The io_unblock callout will only be invoked when you get back to your
> resource manager's main loop (dispatch_block() / dispatch_handle())
> somehow.
> >>
> >> If you are handling the devctl in some way such that the resource
> manager will still be in io_devctl() when the timeout comes, no unblock
> handling will be done.
> >>
> >> In order for unblocking to work properly, you need to somehow put
> "long" (potentially blocking) tasks into the "background" and return to the
> main message handler loop. That could mean doing them in a separate
> thread, or adding entries on an "outstanding tasks" list that you can look into
> when you see a state change (e.g., an interrupt signaling data coming in).
> >>
> >> Regards,
> >> Thomas
> >>
> >> -----Original Message-----
> >> From: Fraser Moore [mailto:community-noreply@qnx.com]
> >> Sent: Freitag, 10. August 2012 09:44
> >> To: ostech-core_os@community.qnx.com
> >> Subject: Re: TimerTimeout() not getting timeout
> >>
> >> I tried defining my own io_unblock that simply calls
> iofunc_unblock_default(). However I never see this function getting called
> by the resource manager. I am new to writing resource managers so what
> should I be doing to handle unblocks?
> >>
> >> cheers,
> >> fraser
> >>
> >> On 09/08/2012 14:52, Lichun Zhu wrote:
> >>> I think this is it, the resmgr did not handle unblock.
> >>>
> >>> -----Original Message-----
> >>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> >>> Sent: Thursday, August 09, 2012 9:44 AM
> >>> To: 'ostech-core_os@community.qnx.com'
> >>> Subject: RE: TimerTimeout() not getting timeout
> >>>
> >>> Does it do proper unblock handling?
> >>>
> >>> -----Original Message-----
> >>> From: Fraser Moore [mailto:community-noreply@qnx.com]
> >>> Sent: Donnerstag, 9. August 2012 15:40
> >>> To: ostech-core_os@community.qnx.com
> >>> Subject: Re: TimerTimeout() not getting timeout
> >>>
> >>> It is one that we have developed.
> >>>
> >>> On...
View Full Message
|
|
|
Thomas Haupt
|
AW: RE: TimerTimeout() not getting timeout
|
Thomas Haupt
08/10/2012 10:47 AM
post94753
|
AW: RE: TimerTimeout() not getting timeout
Of course, that'll leave one thread blocked in io_devctl, potentially forever.
You might want to send a signal to the other thread, cancel it, or not do anything blocking in there in the first place.
What operation is your devctl thread blocked on? What is it waiting for?
----- Originalnachricht -----
Von: David Sarrazin [mailto:community-noreply@qnx.com]
Gesendet: Friday, August 10, 2012 10:40 AM
An: ostech-core_os@community.qnx.com <ostech-core_os@community.qnx.com>
Betreff: RE: TimerTimeout() not getting timeout
Simplest way to is to MsgError(ctp->rcvid), which will unblock the client. It's then very important for your resource
manager to keep track of the fact that it has already replied, and either abort the current operation, or simply skip
over the MsgReply that happens when the devctl thread finishes.
> -----Original Message-----
> From: Fraser Moore [mailto:community-noreply@qnx.com]
> Sent: August-10-12 10:39 AM
> To: ostech-core_os@community.qnx.com
> Subject: Re: TimerTimeout() not getting timeout
>
> I can now get io_unblock to be called from a separate thread but how do I
> then reply to the client which is blocked on another thread to unblock it?
>
> cheers,
> fraser
>
> On 10/08/2012 10:43, Thomas Haupt wrote:
> > Hi Fraser,
> >
> > sure, feel free.
> >
> > Cheers,
> > Thomas
> >
> > -----Original Message-----
> > From: Fraser Moore [mailto:community-noreply@qnx.com]
> > Sent: Freitag, 10. August 2012 10:37
> > To: ostech-core_os@community.qnx.com
> > Subject: Re: TimerTimeout() not getting timeout
> >
> > Hi Thomas, I think that's exactly what's happening. I had just been reading
> the about this in the documentation. I will try and create a new thread to
> handle this.
> >
> > I may be back for more advice.
> >
> > Thanks,
> > Fraser
> >
> > On 10/08/2012 09:25, Thomas Haupt wrote:
> >> The io_unblock callout will only be invoked when you get back to your
> resource manager's main loop (dispatch_block() / dispatch_handle())
> somehow.
> >>
> >> If you are handling the devctl in some way such that the resource
> manager will still be in io_devctl() when the timeout comes, no unblock
> handling will be done.
> >>
> >> In order for unblocking to work properly, you need to somehow put
> "long" (potentially blocking) tasks into the "background" and return to the
> main message handler loop. That could mean doing them in a separate
> thread, or adding entries on an "outstanding tasks" list that you can look into
> when you see a state change (e.g., an interrupt signaling data coming in).
> >>
> >> Regards,
> >> Thomas
> >>
> >> -----Original Message-----
> >> From: Fraser Moore [mailto:community-noreply@qnx.com]
> >> Sent: Freitag, 10. August 2012 09:44
> >> To: ostech-core_os@community.qnx.com
> >> Subject: Re: TimerTimeout() not getting timeout
> >>
> >> I tried defining my own io_unblock that simply calls
> iofunc_unblock_default(). However I never see this function getting called
> by the resource manager. I am new to writing resource managers so what
> should I be doing to handle unblocks?
> >>
> >> cheers,
> >> fraser
> >>
> >> On 09/08/2012 14:52, Lichun Zhu wrote:
> >>> I think this is it, the resmgr did not handle unblock.
> >>>
> >>> -----Original Message-----
> >>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> >>> Sent: Thursday, August 09, 2012 9:44 AM
> >>> To: 'ostech-core_os@community.qnx.com'
> >>> Subject: RE:...
View Full Message
|
|
|
Lichun Zhu
|
RE: TimerTimeout() not getting timeout
|
Lichun Zhu
08/10/2012 10:48 AM
post94754
|
RE: TimerTimeout() not getting timeout
Ideally if this is a single threaded resmgr, the devctl handler should not block if it's waiting for something say there
is no data available at the time, then save the ctp->rcvid for later reply and return _RESMGR_NOREPLY, then you don't
have to create another thread for that.
> -----Original Message-----
> From: David Sarrazin [mailto:community-noreply@qnx.com]
> Sent: August-10-12 10:41 AM
> To: ostech-core_os@community.qnx.com
> Subject: RE: TimerTimeout() not getting timeout
>
> Simplest way to is to MsgError(ctp->rcvid), which will unblock the client. It's
> then very important for your resource manager to keep track of the fact that it
> has already replied, and either abort the current operation, or simply skip over
> the MsgReply that happens when the devctl thread finishes.
>
> > -----Original Message-----
> > From: Fraser Moore [mailto:community-noreply@qnx.com]
> > Sent: August-10-12 10:39 AM
> > To: ostech-core_os@community.qnx.com
> > Subject: Re: TimerTimeout() not getting timeout
> >
> > I can now get io_unblock to be called from a separate thread but how
> > do I then reply to the client which is blocked on another thread to unblock it?
> >
> > cheers,
> > fraser
> >
> > On 10/08/2012 10:43, Thomas Haupt wrote:
> > > Hi Fraser,
> > >
> > > sure, feel free.
> > >
> > > Cheers,
> > > Thomas
> > >
> > > -----Original Message-----
> > > From: Fraser Moore [mailto:community-noreply@qnx.com]
> > > Sent: Freitag, 10. August 2012 10:37
> > > To: ostech-core_os@community.qnx.com
> > > Subject: Re: TimerTimeout() not getting timeout
> > >
> > > Hi Thomas, I think that's exactly what's happening. I had just
> > > been reading
> > the about this in the documentation. I will try and create a new
> > thread to handle this.
> > >
> > > I may be back for more advice.
> > >
> > > Thanks,
> > > Fraser
> > >
> > > On 10/08/2012 09:25, Thomas Haupt wrote:
> > >> The io_unblock callout will only be invoked when you get back to
> > >> your
> > resource manager's main loop (dispatch_block() / dispatch_handle())
> > somehow.
> > >>
> > >> If you are handling the devctl in some way such that the resource
> > manager will still be in io_devctl() when the timeout comes, no
> > unblock handling will be done.
> > >>
> > >> In order for unblocking to work properly, you need to somehow put
> > "long" (potentially blocking) tasks into the "background" and return
> > to the main message handler loop. That could mean doing them in a
> > separate thread, or adding entries on an "outstanding tasks" list that
> > you can look into when you see a state change (e.g., an interrupt signaling
> data coming in).
> > >>
> > >> Regards,
> > >> Thomas
> > >>
> > >> -----Original Message-----
> > >> From: Fraser Moore [mailto:community-noreply@qnx.com]
> > >> Sent: Freitag, 10. August 2012 09:44
> > >> To: ostech-core_os@community.qnx.com
> > >> Subject: Re: TimerTimeout() not getting timeout
> > >>
> > >> I tried defining my own io_unblock that simply calls
> > iofunc_unblock_default(). However I never see this function getting
> > called by the resource manager. I am new to writing resource managers
> > so what should I be doing to handle unblocks?
> > >>
> > >> cheers,
> > >> fraser
> > >>
> > >> On 09/08/2012...
View Full Message
|
|
|
Armin Steinhoff
|
Re: TimerTimeout() not getting timeout
|
Armin Steinhoff
08/10/2012 7:29 AM
post94748
|
Re: TimerTimeout() not getting timeout
Hi,
if you are using QNX6.5 in APIC mode, the interrupt of timer 0 will be
routed to IRQ2 and IRQ0 isn't available.
Checkout if there is a timer 0 interrupt at IRQ2 ...
--Armin
Fraser Moore wrote:
> Hi Thomas, I think that's exactly what's happening. I had just been
> reading the about this in the documentation. I will try and create a
> new thread to handle this.
>
> I may be back for more advice.
>
> Thanks,
> Fraser
>
> On 10/08/2012 09:25, Thomas Haupt wrote:
>> The io_unblock callout will only be invoked when you get back to your resource manager's main loop (dispatch_block()
/ dispatch_handle()) somehow.
>>
>> If you are handling the devctl in some way such that the resource manager will still be in io_devctl() when the
timeout comes, no unblock handling will be done.
>>
>> In order for unblocking to work properly, you need to somehow put "long" (potentially blocking) tasks into the "
background" and return to the main message handler loop. That could mean doing them in a separate thread, or adding
entries on an "outstanding tasks" list that you can look into when you see a state change (e.g., an interrupt signaling
data coming in).
>>
>> Regards,
>> Thomas
>>
>> -----Original Message-----
>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>> Sent: Freitag, 10. August 2012 09:44
>> To: ostech-core_os@community.qnx.com
>> Subject: Re: TimerTimeout() not getting timeout
>>
>> I tried defining my own io_unblock that simply calls iofunc_unblock_default(). However I never see this function
getting called by the resource manager. I am new to writing resource managers so what should I be doing to handle
unblocks?
>>
>> cheers,
>> fraser
>>
>> On 09/08/2012 14:52, Lichun Zhu wrote:
>>> I think this is it, the resmgr did not handle unblock.
>>>
>>> -----Original Message-----
>>> From: Thomas Haupt [mailto:community-noreply@qnx.com]
>>> Sent: Thursday, August 09, 2012 9:44 AM
>>> To: 'ostech-core_os@community.qnx.com'
>>> Subject: RE: TimerTimeout() not getting timeout
>>>
>>> Does it do proper unblock handling?
>>>
>>> -----Original Message-----
>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>> Sent: Donnerstag, 9. August 2012 15:40
>>> To: ostech-core_os@community.qnx.com
>>> Subject: Re: TimerTimeout() not getting timeout
>>>
>>> It is one that we have developed.
>>>
>>> On 09/08/2012 14:28, Thomas Haupt wrote:
>>>> What resource manager is this devctl going to?
>>>>
>>>> - Thomas
>>>>
>>>> -----Original Message-----
>>>> From: Fraser Moore [mailto:community-noreply@qnx.com]
>>>> Sent: Donnerstag, 9. August 2012 15:27
>>>> To: ostech-core_os@community.qnx.com
>>>> Subject: Re: TimerTimeout() not getting timeout
>>>>
>>>> Thanks for the reply. I had tried this but got the same results.
>>>>
>>>> On 09/08/2012 12:05, Gervais Mulongoy wrote:
>>>>> Try setting an unblock event instead of NULL:
>>>>>
>>>>> SIGEV_UNBLOCK_INIT(&ev);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>>
>>>>> OSTech
>>>>> http://community.qnx.com/sf/go/post94710
>>>>> To cancel your subscription to this discussion, please e-mail
>>>>> ostech-core_os-unsubscribe@community.qnx.com
>>>>>
>>>> --
>>>>...
View Full Message
|
|
|
|