pri queue manager/attached .erl file - spawned process exiting

Vance Shipley vances@REDACTED
Fri Apr 19 17:36:22 CEST 2002


The start function has some problems:

start(L) ->
        io:format("Queue: ~w~n",[L]),
        QmPid = spawn(qm,qm,[L]).

The first argument to spawn should be the module name,
in this case 'qmpri'.  The QmPid variable assignment
does noting here as it is lost as soon as the function
is done.

Change it to:

start(L) ->
        io:format("Queue: ~w~n",[L]),

Now you get a process running as you see here:

Erlang (BEAM) emulator version 5.1.1 [source]

Eshell V5.1.1  (abort with ^G)
1> c(qmpri).
2> Qm=qmpri:start([1,2,3,4]).
Queue: [1,2,3,4]
3> i(0, 33, 0).


On Fri, Apr 19, 2002 at 07:51:30PM +0530, Sameer Pendse wrote:
}  guys,
}  i have attached qmpri.erl which implements priority message processing using
}  time-outs. same problem here is that the spawned process exits/dies quietly,
}  pman seems to indicate a badarg situation - but that is not getting thrown
}  to console.
}  1. c(qmpri).
}  2. Qm=qmpri:start([1,2,3,4]).
}  3. qmpri:testdeq(Qm). % this just waits because pid=Qm has vanished
}  can you advise on why qmpri:qm/1 is quitting out of infinite recursion in
}  the absence of a stop message?
}  cheers
}  sameer

More information about the erlang-questions mailing list