multithreading - MailboxProcessor and interaction with GUI Thread -


i've created agent interacting gui means of synchronizationcontext:

type asyncworker(id:int) =     let someevent = new event<int * string>()     let errorevent = new event<_>()     let synccontext = synchronizationcontext.current      let f (inbox: mailboxprocessor<_>)  =          let rec loop () = async {                     let! message = inbox.receive ()             ...             synccontext.raiseevent someevent (id, str)         } 

is there danger in that? if had 20 agents? these raised events synchronized? suppose have long time calculating function event. can sure other agents' event handlers waiting termination?


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -