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

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -