Where to start a pool

41 views
Skip to first unread message

m.fais...@gmail.com

unread,
Jan 19, 2017, 4:38:30 AM1/19/17
to Celluloid
I 'm working first time on multi threading.
My pool will work for life time.
So from where to start the pool.
1 - If start on creating a new User, i.e main thread. main thread halts, and has to wait for the pool to finish work.
2- And Celluloid asks to avoid creating a pool with in an actor. so I can't create some new thread and call a async method in which to create pool.

So Where to create pool ?  

Charles Remes

unread,
Jan 19, 2017, 10:06:58 AM1/19/17
to cellulo...@googlegroups.com
Your item #1 is usually the correct place to start the pool. Alternately have a Supervisor start it.

You need the main thread to wait on something anyway, so why not a pool? If you have a defined event that indicates the program should end, you could signal the main thread to shut down the pool and exit.

I like to use Conditions for this purpose. See this wiki for more details and an example.


cr


--
You received this message because you are subscribed to the Google Groups "Celluloid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to celluloid-rub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages