[Libwebsockets] Removing broadcast

"Andy Green (林安廸)" andy at warmcat.com
Wed Jan 30 06:44:30 CET 2013


On 30/01/13 13:35, the mail apparently from Gregory Junker included:
> On Tue, Jan 29, 2013 at 6:39 AM, "Andy Green (林安廸)" <andy at warmcat.com
> <mailto:andy at warmcat.com>> wrote:
>
>     Instead, the code using the library needs to be arranged to do the
>     library service calls from the same thread that created the context
>
>
> More accurately, from only a single thread at a time? This might cause
> the same confusion people have about GL and D3D -- so long as only one
> thread is accessing a shared data structure at a time, it doesn't
> necessarily have to be the creating thread. This is an important
> distinction in a task-scheduler-based MT app architecture.

Right, what I mean is the same process context (same fork), otherwise it 
won't have the right data; on Linux fork data starts off shared and is 
copied out privately on write.

If it's really a different thread in the same process it could be OK so 
long as no service happens simultaneously.

However mostly I see people using threads / forks to cope with blocking. 
  For libwebsockets, that is not necessary or a good approach... if it 
has to cooperate with other sockets / files the extpoll scheme is the 
best way.

-Andy



More information about the Libwebsockets mailing list