www.virtualacorn.co.uk/forum

For support and advice on VirtualAcorn products
Forums now closed. This is an HTML only record of the content.
HTML version of Forum generated Thursday 24th May 2018

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Task Handle Validity
PostPosted: Sat Oct 17, 2009 11:33 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
I am writing a task to run under Risc OS 3.1 (or later) which uses Wimp_TransferBlock to send data to another task.

So good, so far. However, a problem I have is that the sending task does not know (at the time of the transfer) that the receiving task is actually still running and if it is not an error is generated.

Is there any way in which the sending task can ascertain that the receiving task handle is still valid? (I can not see anything in my PRMs)

_________________
John


Top
 Profile  
 
 Post subject: Re: Task Handle Validity
PostPosted: Sun Oct 18, 2009 11:49 am 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
I think that you need to set up a flag from the receiving task - that can be checked from the transmiting task.

A simple way I have done it in the past (assuming both tasks are proper WIMP apps). Once the receiving task starts up (in it's init routine) I set a variable, for example:

*SET Task$Running TRUE

When this task quits (either through user selection or via an error) the variable is UNSET

Your transmitting task can check this variable to see if the receiver is running.

That's a fairly simple way of doing it...

A much more elegant approach would be for the trasnmitting task to check through the current list of running tasks to ensure that the receiving task is running. Or you could just error trap the transmission routines :-)


Top
 Profile  
 
 Post subject: Re: Task Handle Validity
PostPosted: Sun Oct 18, 2009 5:15 pm 
Offline

Joined: Wed Oct 24, 2007 6:29 pm
Posts: 124
Location: West Lancashire
OK thanks,

All of those options sound feasible.

I was (vaguely) hoping that there was a SWI which would do it one one operation. :(

More wishful thinking :lol:

_________________
John


Top
 Profile  
 
 Post subject: Re: Task Handle Validity
PostPosted: Mon Oct 19, 2009 12:17 pm 
Offline
Site Admin

Joined: Wed Oct 23, 2002 12:16 pm
Posts: 958
I am not aware of an "automatic" way of doing this - like much in the RISC OS desktop you need to work out how to do it yourself :-(


Top
 Profile  
 
 
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

   
cron
Forums originally Powered by phpBB © 2007 phpBB Group. Contents © 3QD Developments Ltd 2018 version no. 1.07