Different gen behaviours have different relations to processes. gen_server
and gen_fsm
have one process per instance (you can have multiple processes running the same gen_server
code). Whereas gen_event
is running the handle_event callbacks synchronously in the context of the calling process (gen_event:call
) or asynchronous in the context of the event manager process (gen_event:notify
).
The gen behaviours are there to abstract away the concurrency and use processes to achieve this. How they are doing this and if there is a 1:1 relationship between processes and gen behaviours depends on the implementation of the actual gen behaviour.