[Red5] using Thread.sleep in red5 app

Dominick Accattato daccattato at gmail.com
Mon Jun 15 12:24:15 PDT 2009


I'll bring this up to Joachim.

On Mon, Jun 15, 2009 at 3:21 PM, Tyler Kocheran <rfkrocktk at gmail.com> wrote:

> Why do we even have a distinction between MultiThreadedApplicationAdapter
> and ApplicationAdapter? If someone really wants a singlethreaded adapter,
> they can simply override the methods they want to be synchronous (*connect,
> *join, *leave, *disconnect). Maybe instead of having this weird flipped tree
> where ApplicationAdapter (singlethreaded) extends
> MultiThreadedApplicationAdapter (multithreaded), we could have
> ApplicationAdapter be multithreaded and make a
> SingleThreadedApplicationAdapter, removing some confusion.
>
> Sorry, this is a rant :)
>
> Is there a way to make service calls multithreaded? In RMI-driven apps,
> this is key.
>
> On Mon, Jun 15, 2009 at 12:15 PM, Dominick Accattato <daccattato at gmail.com
> > wrote:
>
>> reading far back on the mailing list, you will find the following from
>> Joachim.
>>
>> there is no change in the threading model used in Red5. I just removed
>> the class synchronization on scopes and connections that was active
>> when clients connected or disconnected.
>> This resulted in the application handlers like *Connect, *Join, *Leave
>> and *Disconnect being called single-threaded and thus blocking each
>> other.
>> So the only change visible to developers is that if you extend
>> MultiThreadedApplicationAdapter instead of ApplicationAdapter, these
>> handlers will be called from multiple threads simultaneously.
>>
>>
>>
>> On Mon, Jun 15, 2009 at 1:32 PM, Tyler Kocheran <rfkrocktk at gmail.com>wrote:
>>
>>> So access to RMI services is singlethreaded? That's a bummer! I thought
>>> for sure it'd be multithreaded/pooled.
>>>
>>>  - TK
>>>
>>>
>>> On Mon, Jun 15, 2009 at 7:49 AM, Dominick Accattato <
>>> daccattato at gmail.com> wrote:
>>>
>>>> If you place a Thread.sleep() in your service or in your application
>>>> adapter you will indeed pause the entire application.  These run in the same
>>>> thread.  The only time you can set a Thread.sleep() without it effecting
>>>> your entire application is if you spin off a new thread.  Keep in mind that
>>>> if you use the scheduling service you will be spawning a new Thread.  In
>>>> your scheduled job, you may set a sleep without affecting the rest of the
>>>> application.  Hope this helps!
>>>>
>>>>  Dominick Accattato
>>>> CTO & Senior Engineer
>>>> www.infrared5.com
>>>> 315.717.2818
>>>>
>>>>
>>>>
>>>> On Mon, Jun 15, 2009 at 10:32 AM, Aljosa Mohorovic <
>>>> aljosa.mohorovic at gmail.com> wrote:
>>>>
>>>>> if i register service in roomStart() like this:
>>>>>
>>>>> --------------------------------------------------------------------------------------
>>>>> @Override
>>>>> public boolean roomStart(IScope room) {
>>>>>    MyService my_service = new MyService();
>>>>>
>>>>>    String room_service = "room" + room.getName();
>>>>>    room.registerServiceHandler(room_service, my_service);
>>>>> }
>>>>>
>>>>> --------------------------------------------------------------------------------------
>>>>>
>>>>> and then i call "Thread.sleep(3000);" somewhere in MyService class
>>>>> will this code "pause execution" only in MyService/room or will it
>>>>> pause entire app?
>>>>>
>>>>> Aljosa Mohorovic
>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> Red5 at osflash.org
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>
>>>>
>>>
>>>
>>> --
>>> And do this, knowing the time, that now it is high time to awake out of
>>> sleep;
>>> for now our salvation is nearer than when we first believed.
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>
>
> --
> And do this, knowing the time, that now it is high time to awake out of
> sleep;
> for now our salvation is nearer than when we first believed.
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090615/fd5c85d9/attachment-0001.html>


More information about the Red5 mailing list