Spinroot

A forum for Spin users

You are not logged in.

#1 Re: General » Confusion over atomicity and send/receive operation » 2012-08-13 13:31:27

Ok, thanks. back to the drawing board then because in my actual model (much more complicated) it doesn't do that so.... obviously I'm missing something. thanks!

#2 General » Confusion over atomicity and send/receive operation » 2012-08-10 21:37:46

rileyrob
Replies: 3

Hi,

I know that for a rendezvous, when the message is passed (handshake takes place), the recipient immediately begins running. But I thought for an asynchronous send wrapped in atomicity, the sent message would simply be stored in the recipient's buffer (so long as channel wasn't full) and the sender would continue executing to the closing brace of its atomic clause before the receive got to do anything. For example, given the following:

/* Asynchronous, NOT rondezvous */
chan chInbound = [5] of { mtype };
chan chOutbound = [5] of { mtype, bool};

active proctype ProcA()
{
   do
        :: chOutbound?EID_PKT, oppAvail -> chInbound!RES_REQ                   
        :: timeout -> skip;                     
   od;
}

active proctype ProcB()
{
   show int cnt;
    
   do
        :: atomic { chOutbound!EID_PKT, oppAvail -> cnt++;  }
        :: timeout -> skip;                     
   od;
}


Assuming chOutbound is NOT full, I would have thought that if ProcB ran and sent the EID_PKT msg to ProcA, it would then continue on to increment the cnt variable. However, instead what I'm seeing is that, upon receipt of the EID_PKT, ProcA immediately starts running and sends the RES_REQ msg. Am I totally misunderstanding how atomicity works? How do I prevent the receiver from acting on the message until the sender is finished doing what it needed to do?

Any guidance would be greatly appreciated!

Thanks,
Robin

#3 Re: General » "Access denied" when attempting to compile verifier from cmd line » 2012-08-07 13:00:16

actually, for some reason when cygwin installed, it installed with everything read-only, no execute permission. once i changed permissions, it worked. thanks

#4 General » "Access denied" when attempting to compile verifier from cmd line » 2012-07-31 21:56:46

rileyrob
Replies: 2

Hi,

From the command line, I built my model and attempted to compile the verifier and it gives me "Access Denied":

      C:\Data\ProtocolAnalysis>spin -a RA_Scheduling.pml

      C:\Data\ProtocolAnalysis>cc -o pan pan.c
      Access is denied.

      C:\Data\ProtocolAnalysis>

Does anyone know why I'm getting access denied? I am running on Windows 7 and I know some things require you to run as administrator but I have administrator privileges on my machine. Additionally, I can generate/run the verifier from within the GUI so...

Thanks,
Robin

#5 Re: General » Modeling a protocol/state machine that uses timers » 2012-07-31 19:18:21

oh, wait... i already did look at that doc - found it difficult to follow smile

#6 Re: General » Modeling a protocol/state machine that uses timers » 2012-07-31 19:16:07

Hmm, I tried using the timeout mechanism but only with partial success. I.e., I ended up with some unreachable states. I.e., I could never reach the "attempts less than max so retry" or some timeouts in certain states. Perhaps it's a problem with my logic. I'll revisit that and also take a look at the url you recommended. Thanks!

#7 General » Modeling a protocol/state machine that uses timers » 2012-07-31 19:02:01

rileyrob
Replies: 3

Hi,

I need to model a protocol (using channels) but it's not simply back and forth passing of messages. Rather, there are states involved. For example, the following pseudo code is for process_A which is exchanging protocol messages with process_B:

numAttempts = 0;

Wait_RA_State:
   start RA-timer;
   wait for either RA-timer to expire or for RA-msg from process_B;
   if timer expires, go to Exit_State; else start ack timer, send req msg to process_B; numAttempts++; goto Wait_ACK_State;

Wait_ACK_State:
   wait for either ack timer to expire or ack msg to arrive from process_B;
   if timer expires and numAttempts < MAX_ATTEMPTS, go to Wait_RA_State;
   else if timer expires and numAttempts == MAX_ATTEMPTS goto Exit_State;
   else we received ack from process_B so go to DoStuff_State;

I know Spin/Promela does not support the concept of timers but I was wondering if anyone had any suggestions on how I could simulate the timer action so as to capture all possible scenarios (i.e., RA-timer expiration, ack timer expiration, as well as getting the messages before the timer expires.

Any thoughts would be greatly appreciated.

Regards,
Robin

Board footer

Powered by FluxBB