question

Denise H2 avatar image
0 Likes"
Denise H2 asked tannerp commented

How to solve a deadlock?

deadlock.fsm

Hey guys,

may you can help me. I need to solve a "deadlock", but I'm not sure how it should work.

The problem is, that the Operator is aquired in step 1, in step 1 you need to acquire die processor of step 2. But processor of step 2 is already required and needs to be released by the Operator. So a deadlock exists.

You can find my modell attached.

Hope you can help me!!

Thank you in advance!

FlexSim 18.0.5
operatorprocessordeadlock
deadlock.fsm (40.2 KiB)
deadlock.fsm (40.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Axel Kohonen avatar image
0 Likes"
Axel Kohonen answered Denise H2 commented

Hi @Denise H2

Would it be possible for you to rewrite the process flow so that you always acquire both the operator and the processor and not continue if you cannot get both? You could do this e.g. by first acquiring the operator and having the acquire processor directly after it with a Max Wait timer with time zero for the acquire. If you cannot acquire both operator and processor then you return to the start of the process flow.

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Denise H2 avatar image Denise H2 commented ·

Thank you @Axel Kohonen.

I'm not sure if I got it right, but in this case, the Processor 3 will always be acquired if the Operator ist acquired in step 1? So Processsor 3 would be blocked for a long time (during Processor 1 or 2 are processing) without processing?

0 Likes 0 ·
Axel Kohonen avatar image Axel Kohonen commented ·

Hi @Denise H2

I see, I misunderstood your question originally. In case you do not need to use process flow for some certain reason I would suggest connecting the sources, processors and the sink as the flow goes and then checking the "Use transport" checkbox under the Flow tab of the sources and processors as in the attached model. I have connected the operator to the centerport so that the model knows which operator to use.

In case you want multiple operators you can connect a dispatcher to the center port of the sources and processors and then the operators to the dispatcher.

processorsmodel.fsm

In case you want to use process flow you can use the create task sequence to create the travel, load, travel, unload task sequence and dispatch them as a whole. But the solution in the attached model is easier in this case.

0 Likes 0 ·
processorsmodel.fsm (39.6 KiB)
Denise H2 avatar image Denise H2 commented ·

No, you don't misunderstood my question. I'm builiding a bigger modell where it is necessary to use process flow.
Do you have a example how the "create Task sequence" ist working? :-)

0 Likes 0 ·
Axel Kohonen avatar image Axel Kohonen Denise H2 commented ·

Hi @Denise H2

In its most basic form it is like in the attached model. So you create the task sequence without giving a task executer/dispatcher, set all the tasks to not "Wait until complete" and then give the dispatcher/task executer in the dispatch TS activity.

Note that it is not always very easy to use create task sequences with resources that are reserved in one place of the process flow and freed in some other place. So I would still recommend using the normal flow for this and then using process flow as a higher level "intelligence". But since I do not know about your real model I cannot real say what is better.

1 Like 1 ·