Multi-threaded server with independent IO

I have designed a multi-threaded server which handles XML via sockets. I am running into the issue that when I try to send data to all of the clients, I have having to iterate through a shared resource where the sockets are stored at. I do not have this problem with reading because it is done in the thread created for this client (I pass the socket into the thread). If one computer freezes, then the iteration (writeToAll) through the client sockets also freeze. I would like to send XML to all clients and have everything fully independent so if it has a problem writing to a client, then it wouldn't halt the server. I would spawn a new thread for each write but that wouldn't be practical and I worry about threads live-locked.
I have looked into JCSP and it looks promising for the common issues associated with thread programming, but this is more of a design issue.
Any robust multi-threaded servers out there for enterprise use and scalability?

A basic server which provides an example of what I mean:
http://www.wellho.net/solutions/java-a-multithreaded-server-in-java.html
connectiontable is a non-synchronized static method; I use a synchronized non-static method. I do not know which one I need to use.
The problem: If a socket "lingers" on sending output* (ex if the client is frozen but the socket is still bounded), then it never throws an exception!
*Sending from a shared resource (hashtable) on the parent thread (where the serversocket resides).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Multi-thread server with UD32

    Hi
    I have build server with -t for muli-thrread option, it boots fine too. When I
    use UD32 < file. ud it does not work.
    I get following error in ULOG.
    103708.gdev!ProxSvr.26508.4.1: LIBTUX_CAT:6126: INFO: New server dispatched thread
    starting
    103708.gdev!ProxSvr.26508.1.-2: LIBTUX_CAT:476: WARN: Server 3/511: client process
    26500: lost message
    103708.gdev!ProxSvr.26508.1.-2: LIBTUX_CAT:477: WARN: SERVICE=PROXSVC MSG_ID=0
    REASON=server died
    It work when server is not build with -t option.
    Any help ?
    Vijay

    Here's a huge list of SOAP servers:
    http://www.soapware.org/directory/4/implementations
    Here's a SOAP/RMI product called XSOAP that might make more sense for you.
    http://www.extreme.indiana.edu/xgws/xsoap/

  • Multi Thread Server over TCP/IP

    Multi Thread Server over TCP/IP. Does it work?
    In my box it works only over IPC protocol.
    null

    S C Maturi (guest) wrote:
    : Mark Malakanov (guest) wrote:
    : : Multi Thread Server over TCP/IP. Does it work?
    : : In my box it works only over IPC protocol.
    : Mark,
    : Multi threaded server over TCP/IP will not work with
    : the current distribution of Oracle 8.0.5 on Linux.
    : This is corrected and a patch would be released soon.
    : Maturi
    tcp 0 0 bock.nettek-ll:listener bock.nettek-
    llc.co:4196 ESTABLISHED
    tcp 0 0 bock.nettek-llc.co:4196 bock.nettek-
    ll:listener ESTABLISHED
    (I have serveral of these)
    TNS Ping Utility for Linux: Version 8.0.5.0.0 - Production on 07-
    JAN-99 18:45:52
    (c) Copyright 1997 Oracle Corporation. All rights reserved.
    Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)
    (PORT=1521))
    OK (440 msec)
    ...and from my install log you see that I selected MTS:
    -[ YESNO
    Q> Would you like MTS (Multi-Threaded Server) configured
    and the SQL*Net$
    A> TRUE
    Please explain? Will TCP/IP MTS work via the loopback adapter
    only? So far I have not tried a remote TCP/IP connection.
    -STEVEl
    null

  • Enterprise User and Multi Thread Server

    Hi,
    We are going to build a system which uses a configuration:
    10g2
    Enterprise User
    Multi Thread Server
    Client apps accesses db over JDBC/SSL
    Could some please share experience about issues regarding
    using Enterprise User and Multi Thread Server ?
    Is MTS transparant for Enterprise User authentication ?
    Regards,
    Cezary

    If you build simpserv with -t, and set MIN and MAXDISPATCHTHREADS, you
    should have an example of a multithreaded server.
         Scott
    Johan Philippe wrote:
    >
    We have been going to the documentation on multi-threading and contexting in servers
    on Tuxedo 7.1.
    And the impression so far is that apart from the function definitions there is
    not much information around.
    Didn't even find a simple example of a multi-threaded server in the Bea refs yet.
    Does anyone know/have such an example?
    And is anyone using multi-contexting in a server, because the limitation that
    only server-dispatched
    thread get a context puts quite a limitation on its usefullness.

  • Found Dead Multi-Threaded Server Error!!!

    I am in the process of testing an application based on EJBs deployed on an Oracle 8.1.5 database.
    Some times the whole instance chashes without any obvious reason.
    The error reported in the Alert file is
    "found dead multi-threaded server 'SOOO',pid(8,1). Terminating Instance".
    I check my code and i think that there is no problem with cleaning up resources. I increased also the JAVA_POOL_SIZE and LARGE_POOL_SIZE size without any result.
    Can anybody give me a hint for the error cause?
    Thanks in advance.
    null

    go on metalink http://metalink.oracle.com
    Good Luck,
    Fred

  • Can anybody know how to configure Multi threaded server?

    Hi
    All,
    Can anybody know how to configure Multi threaded server?
    Thanks,
    Vishal

    Values are just samples only. use what ever appropriate for your environment. Understand each of them before using in production.
    alter system set DISPATCHERS="(PROTOCOL=tcp)(DISPATCHERS=3)(CONNECTIONS=1000)"
    alter system set shared_servers=100
    replace "DEDICATED" with "SHARED" in tns names
    Ready to go.
    select username,server from gv$session (server should show none or shared)

  • Multi-threaded server programming

    Hello, I meet a problem and don't know how to solve it: I have created a multi-threaded server program which receives multiple users from their own PCs. The server program receives users'commands and echo it back to all users who are currently connecting to my server. I store every clientSocket connecting to my server into a vector. My question is: how the server broadcasts a user command to other users? And how the server knows to which user he will echo the command to since the hostName and port number are the same to every user currently connecting to my server? Thanks a lot.

    You should look at extending the Socket class to encorporate user details. Either use what peter suggested or make the user pass a username (or something) when they connect.
    When you want to broadcast to all users just enumerate through your vector and send each one the command. If you mean the user performs a task on their application and you want to produce the same results in all the other users apps then its down to you to code it. When user1 clicks on a button the app must send a command (eg. a string) to the server which sends the same string to all other users. When the user receives this string it performs some task.
    Is that what you mean?
    Ted.

  • Found dead multi-threaded server

    hi all
    My database is not running in multithread mode.
    mts_dispatchers = "(protocol=TCP)"
    I am getting such error
    found dead multi-threaded server 'S000', pid = (8, 4)
    Pl guide me
    suresh

    go on metalink http://metalink.oracle.com
    Good Luck,
    Fred

  • Dedicated server vs multi threaded server archcitechture ( shared servers)

    http://www.dba-oracle.com/t_mts_multithreaded_servers_shared.htm
    1. I read the above for dedicated server vs multi threaded server archcitechture ( shared servers), please make it easy for a novice like me to understand in brief. Is the difference between the two only that MTS spawn multiple virtual servers which share and same memor ?
    2. How does the dedicated server work right from a db user logs in to when the user logs out ?
    Thanks in advance.
    Gony

    Posting it in [General Forum|http://forums.oracle.com/forums/forum.jspa?forumID=61] is more appropriate.
    SS

  • Writing a multi-threaded server

    Hi. I'm working in a starting project here at my company and, as a requirement, I must implement a multithreaded server using SSL connections (SSL over Socket). The secure connection is no longer a concern (after a lot of struggle, I build a simple client/server over SSLSockets that actually works), but I still need to build all the multithreaded code... I'm needing some guidelines and design ideas. Any ideas? Can someone post some interesting links about this subject?
    Thanks in advance!

    >
    For example why must it be multi-threaded in thefirst
    place?Because it will serve a few tens of people
    concurrently.
    tens? Like 50 people or 500 people?
    And how many threads? 3 or 60,000?I do not know yet, but I'm assuming it will be one
    thread per socket connection and possibly another few
    threads doing housekeeping stuff (managing files,
    etc)
    And how long will a thread last? What sort of
    processing will it do?Ain't got all requirements yet!! But basically (at
    least what I understood) it's going to receive lots of
    data, process it and re-route the data to a mainframe
    So 5O (or 500) people are going to connect...
    1. Once a week and deliver 10 giga bytes of data?
    2. Once a minute and deliber 10 giga bytes of data?
    3. Once a week and deliver 1,000 bytes of data?
    4. Once a minute and deliber 1,000 bytes of data?
    And then the general questions for any 'server'...
    -What happens when the server (box or application)fails
    Well, nothing has been said about that matter yet, but
    I guess the server got to resume (or discard)
    unfinished stuff (depending on the status of the
    received data before the connection was lost)
    And how is it going to do that on the 'mainframe'?
    Two easy paths.
    1. The mainframe has a database interface AND the data volume is low enough then you can use transactions.
    2. The data does not have to be committed at once. This could be because it just doesn't always need to go, or because it is 'sequential' (which still requires code but not much.)
    Really hard paths.
    1. 'Lots' of data and it all must be committed at 'once'.
    2. There is no database interface and data must be committed.
    -What is the expected scaling requirements?No clustering involved - it will run on a single
    machine, during a limited time. The system in question
    is a 'contingency control' (not sure about this term
    in English), so it will run when (and if) our client
    get screwed in any way - their buildings destroyed,
    that kind of stuff...
    -How will it be maintained?Sorry, I didn't understood, could you clarify?
    Someone has to make sure the box and application is running. Who is going to do that? What tools will they need to do this?
    If it is you and the users call you directly if it doesn't work then it is easy (code wise.) If it is someone else then you will need to provide tools to ease that. And if someone expects it to work in an automated management system (like with SNMP) it is going to be even more complicated.

  • Multi-Threaded server using  ThreadPool

    Dear friends,
    I am writing a client-server program in which the client and server communicate using SUN-RPC. The client reads a file containing some numbers and then spawns threads which it uses to request the server for a service. These threads are executed using a thread pool. Till this time, it's working fine. But when it comes to the server, the real trouble begins because it too needs to be made a multi-threaded one using thread pooling. The server has to capture the call information for each request for the service and then pass this information to a thread/runnable object in whose run() method the code for execution of the service would be present. Since the tasks(requests for the service) are not present already, i am unable to execute the server side threads in a loop using a thread pool. How to solve this problem? Kindly help.
    Thanks,
    Subhash

    The server has to capture the call information for each request for the serviceWhy?
    and then pass this information to a thread/runnable object in whose run() method the code for execution of the service would be present.Why can't the run() method get the call information when it starts? That's what's normally done. The server's accept loop mustn't do any other I/O: otherwise a rogue client can block the server complete.y

  • SAP XI on a multi-core, multi-thread server?

    Hi Everyone!
    Can anyone tell me whether SAP XI can run on a Server whose processor is multi-core, multi thread (4 cores, 8 threads per core, 32 threads)?
    Thanks in advance!
    Warm regards,
    Glenn

    Hi Ravi,
    Thanks for your reply! The server in question is SUN Solaris. What sort of confguration needs to be done on both the OS side and on XI? Is there a SAP note I can follow?
    Warm regards,
    Glenn

  • Application Server Configuration with Multi-threaded Server

    Hi, friends:
    We seems to have some problem with our OAS configuration. Even our Oracle8 server is set as MTS, when we query through the OAS, everytime one request won't be processed until the previous one finished. How to configure OAS to process queries in parellel?
    Also, is there anyway that we can cancel a running query? Because, usually our query is very time-consuming. But even we stopped it apparently in the interface end, we know it is still running backend. Performance is bad.
    Thank you, Thank you.
    David

    Hi Balaji,
    The Application server step by step guide is in the same guide as the CI installation guide. If you don't have it already you can download it from SAP Marketplace.
    Regards
    Juan

  • Multi-Thread logging with PrintWriter

    Hi,
    I'm trying to buffer up some log information and flush it out to a log file at the end of servlet.
    If I do something like following in a servlet where multiple threaded are doing the same thing, would System.out be a bottleneck? I can see that sometimes, some flush() might get called prematuarely, but I guess that is ok.. any issues with following approach in a servlet?
    Thanks
    PrintWriter pw = new PrintWriter( System.out );
    pw.print( "some info" );
    pw.print( "more info" );
    pw.print( "more info" );
    pw.flush();

    If you are writing to a log file...why not use a Logger class.
    the latest java JDK come with a Logger class. I prefer log4j (apache.jakarta site). The logger can display the thread name, time, what method is being invoked.
    Otherwise, just use a StringBuffer and append the System.out until you are ready to print. then create the printer there and print. IO is expensive.

  • Multi threaded Server

    Hi all,
    I am not a DBA and don't have DBA acces on my production server. Please let me know how to identify,MTS is enabled on my server or not?
    Also I found this in statspack report
    session pga memory                     7,211,525,400       46,291.5        652.5
    session pga memory max                 9,380,680,064       60,215.6        848.7
    session uga memory                 2,779,758,410,912   17,843,556.3    251,495.4
    session uga memory max                21,093,800,328      135,403.3      1,908.4Can I say 'Session UGA Memory' is high because shared server is used by these sessions?
    Also If MTS is enabled/installed and if I don't give server=dedicated or server=shared in my tnsnames, then that session would use shared connection or dedicated connection?
    I am using oracle 9i rel2
    Thanks in advance,
    Jaggyam

    Hi,
    I am not a DBA and don't have DBA acces on my production server. Please let me know how to identify,MTS is enabled on my server or not?If you can check the init parameter by querying v$parameter then check value for shared_servers, dispatchers. They should be greater than 0
    Can I say 'Session UGA Memory' is high because shared server is used by these sessions?No you cannot.
    Also If MTS is enabled/installed and if I don't give server=dedicated or server=shared in my tnsnames, then that session would use shared connection or dedicated connection? It should use shared connection if possible like availability of dispatchers etc. If it is not possible to connect through shared server then it uses dedicated server.
    Regards
    Anurag Tibrewal

Maybe you are looking for