| close() of active socket does not work on FreeBSD 6 |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- iulivarzariuda.. invites you to Going.comHey! Check out this cool new site Going.com. They'll keep you posted
on What's Happening and Who's Going around town.
- Be in the know about fun events, concerts, parties and see who's
going.
- Keep up with your friends and share what you are up to.
- Get invited to exclusive Going.com sponsored special events.
I figured you would want in on it too. Check it out at:
http://going.com/join_me/SsPiUUVYFC
iulivarzariuda..
This email was sent by the person in the from line and the subject
line. Please email them directly if you have any questions.
Going is compliant with the Can-Spam Act of 2003. For more
information, read our privacy policy at
http://going.com/privacy_policy.php.
Going, Inc - 8 Winter Street, Boston, MA 02108, USA
email***@***.com
- 1
- Any good GUI design/prototyper tools?I'm looking for a tool that will let me quickly design/prototype Swing
GUI layouts so I can get screenshots for review by end users. The
emphasis is on design, not building as such - I'm not interested in
*using* any generated code at this stage, although the tool needs to
be able to save and load layouts, and preview the layouts.
What is really required is something that works like a drawing program
but with Swing components. Ideally it would:
o Allow absolute positioning and sizing, because at this stage I'm
essentially doing graphic design and don't want to be worrying about
implementation of layout managers
o Allow easy moving and alignment of elements or groups of elements
o Have a Property Editor, but with configuration of defaults so that I
don't have to, for example, change the font on every element.
o Have a quick build/preview so I can get screenshots easily.
I have looked at a few IDEs and GUI builder tools, but so far nothing
seems really orientated towards making this particular task quick and
easy. Does anyone know of anything that's appropriate... or should I
be thinking about coding something myself?
- 1
- OutOfMemoryError - Any Way to Exit JVM?Hi all,
We're having a major problem keeping Java calculators (that were
written by a third party vendor) alive. They leak memory and
eventually cause OutOfMemoryErrors. We cannot address the problem
directly until the vendor does, so we need to manage these dying
calculators.
Unfortunately, they are all started in separate processes and an
OutOfMemory error seems to kill *only* the thread, NOT the JVM. Is
there a way to ensure that the JVM dies as well?
My real hope is that some JVM has a command line option to kill the
whole thing when it has an allocation error. Otherwise, perhaps we can
add another thread to the process that watches it, but that's harder.
Any help would be greatly appreciated.
Thanks,
Steve Lieberman
- 2
- junit test in eclipse
code from some tutorial
---------
import junit.framework.TestCase;
public class SampleTest extends TestCase {
...
}
---------
code from another tutorial
---------
import org.junit.*;
import static org.junit.Assert.*;
public class SampleTest {
...
}
---------
Second one is working well. I think second one is simpler, so I like it.
But I can't use them with TestSuite.
"
The method addTest(Test) in the type TestSuite is not applicable for the
arguments
(Class<ArmorTypeWrapperTest>)
"
---------
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for vanguard.wardrobe");
//$JUnit-BEGIN$
suite.addTest(ArmorTypeTest.class);
suite.addTest(ArmorTypeWrapperTest.class);
//$JUnit-END$
return suite;
}
}
---------
Thank you
Sean
- 2
- How to get you Extenal/Real IP (Router)Hi All,
I am writing a code as a Java Application (not Applet or Servlet) and I
am trying to find out what is my real IP address (not 192.168. one). I
am behind my LinkSys router and everything I try I still get 192.168.
I have tried:
- InetAddress: Always returns 192.168 address (unless I am missing
something).
- Open Socket to www.cnn.com,80 and read local address (still 192.168).
- I am reading about Upnp but not sure if that's the way I can ask my
Router about my real IP.
- Calling http://www.whatismyip.com and parse the result seems too
strange.
Any idea?
Thanks in advance,
Homer
- 2
- JBoss e eccezioni...Ciao a tutti, ho un problema con JBoss! Ogni volta che entra in errore
la mia applicazione, JBoss s'impalla e rimango in pending 10 minuti
prima che mi lanci fuori un eccezione. Avete idea se ci sono variabili
da settare perch?non rimanga cos?tanto in attesa? Grazie.
- 2
- Positioning scrollable dataI have pasted a bare bones program below which demonstrates the
problem I am trying to solve.
I have a JTextArea on a JScrollPane, and the number of lines to be
displayed exceeds the display area. Thus scrolling is activated, and
the starting screen shows from line 1 onwards with the scrollbars
available for scrolling. So far so good.
Now I want to redisplay another screen. Once again the number of lines
exceeds the display area, This time around though, the END of the
lines are displayed. Instead of (for instance) lines 1 to 10 of 100
lines being displayed, lines 90 to 100 are being displayed.
I don't want this. Each time I want to data on the JTextArea to be
displayed from line 1 onwards.
Some research that I did indicated that getViewport().setViewPosition
would be my friend. However, as you can see in the code below, I DID
code this, but it would not work.
Does anybody have an idea how to change the code below so that I can
get the display that I want?
Thanks!
/*
* Example code to demonstrate the problem:
* The first time the data in the JTextArea is displayed,
* the data is positioned at the first line.
* Subsequently (after clicking the Next button), the data
* is positioned such that the last line is displayed.
* I want to reposition the data in the JTextArea such
* that each time after a refresh, the first line of the data
* should be displayed.
***********************************************/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Example extends JFrame implements ActionListener
{
JTextArea textArea;
JScrollPane js;
JButton nextButton = new JButton( "Next" );
JButton endButton = new JButton( "End" );
int counter = -1;
Example()
{
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
textArea = new JTextArea( 15, 50);
textArea.append( " " );
js = new JScrollPane( textArea );
nextButton.addActionListener( this );
endButton.addActionListener( this );
JPanel pane = new JPanel();
pane.setLayout( new FlowLayout() );
pane.add( nextButton );
pane.add( endButton);
pane.add( js );
setContentPane( pane );
setLines();
setTitle("Example");
setSize(600,400);
setVisible(true);
} //end constructor
public void actionPerformed( ActionEvent evt )
{
Object source = evt.getSource();
if( source == nextButton )
{
setLines();
}
else if( source == endButton )
{
System.exit(0);
}
repaint();
}
void setLines()
{
textArea.setText( "" );
counter++;
for( int n=0; n<100; n++ )
{
textArea.append( counter + " " + n + "This line is filler
data to demonstrate problem\n" );
}
// Attempt to position to top of data... but it does not work :(
js.getViewport().setViewPosition( new Point( 0,0 ) );
}
public static void main( String[] args )
{
new Example();
}
}
- 2
- java.lang.NoClassDefFoundError when calling method from EJBI have a java app that runs on Websphere 6.0 and I needed a way to run
a scheduled task once a day that sends out emails. I used the
following link from IBM's site to develop a stateless EJB session bean
that ran the WAS task scheduler.
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/scheduler/tasks/tsch_schedulebtask.html
I placed a call in the implemented process method (just like the
example says) to a non-EJB method and I get a
java.lang.NoClassDefFoundError error on the method I am tryign to call.
I'm new to EJB so I'm not sure if you can even make a call from an EJB
to a normal (non-EJB) method. Any help would be appreciated.
- 8
- How to add a button next to title at the JTabbedPaneHi,
I want to add a small button next to the title of each tabbed pane and
receive user's mouse click event at the small button.
And finally, the selected pane will be removed.
How to add other object, button, into Title part of JTabbedPane ?
Any ideas?
- 9
- Finding path of running classFile currentDir = new File(System.getProperty("user.dir"));
I need to know the path to a class that is running and have had
partial success. The code shown above finds the folder where the JVM
is running.
If I start my app from a terminal window or a native executable IDE,
the JVM will run in the folder where my class is located and
currentDir points to the folder that I need. But if I start the app
from an IDE written in Java, I get the folder where the IDE is located
rather than the folder where the app that I was running is located.
My app will be used in a classroom setting by people who will NOT have
command prompt permissions. They will have to run it from an IDE.
I'd really like to stick with the one that we're currently using
(written in Java).
Apparently, both the IDE and my application are running in the same
JVM. Is there any way to get the application to run in its own JVM so
user.dir points to that folder?
If not, any other suggestions?
TIA
tom
- 9
- Refusing TCP connections - ServerSocketI want to create a ServerSocket.
I want it to accept one connection.
If another connection request comes in, I want it to be refused, not queued.
Even if I set backlog to 1, on the OS I'm testing on (Linux) I'm able to
queue up a bunch more connections (5 or 6).
I know the actual backlog size is OS dependent even if I explicitly set it
in the ServerSocket constructor.
So, how do I refuse all subsequent connections after I accept that first one?
--
Steve Sobol, Victorville, CA PGP:0xE3AE35ED www.SteveSobol.com
Geek-for-hire. Details: http://www.linkedin.com/in/stevesobol
- 13
- 13
- cannot call a paint function across classes?Just wondering if this is possible, as im having no luck working it out, no
matter what ive tried so far..
I have 2 classes, lets call them gP and kP. in gP ive got this function:
public void paint55(java.awt.Graphics graphics) {
Dimension d=getSize();
graphics.setColor(Color.RED);
graphics.fillRect(0, 0, (int)d.getWidth(), (int)d.getHeight());
graphics.setColor(Color.BLACK);
//call another function here
}
now, in the kP class, im using a jComboBox, the combo box works fine, but i
want to try and call that function from it
Ive tried
gP.paint55();
ive tried referencing it as gP paint55();
Just cant work it out, any ideas?
Thanks
- 16
- sending raw data to a printer driverIn Windows I have some win32 code that I use in VC++ programs to send
raw data to the printer driver. I would like to do the same thing in
Java; does anyone know how to do this. Specifically, I need to send
printer codes or language commands to a printer. Specifically in the
case I am trying to write is to be a able to send command codes to an
Intermec barcode printer through a text file which has IPL (Intermec
Printer Language) code in it. It is just text, but it instructs the
printer what to do. Of course the printer code is not restricted to
just printer codes. If I could figure out how to send raw data to the
printer driver, this would help a lot.
Z.K.
- 16
|
| Author |
Message |
davidxu

|
Posted: 2006-12-13 7:33:00 |
Top |
java-programmer, close() of active socket does not work on FreeBSD 6
On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
> > In message <email***@***.com>, Bruce Evans writes:
> >> On Mon, 11 Dec 2006, Daniel Eischen wrote:
> >>
> >> It's probably a nightmare in the kernel too. close() starts looking
> >> like revoke(), and revoke() has large problems and bugs in this area.
> >
> > There is the distinctive difference that revoke() operates on a name
> > and close() on a filedescriptor, but otherwise I agree.
>
> Well, if threads waiting on IO are interruptable by signals,
> can't we make a new signal that's only used by the kernel
> and send it to all threads waiting on IO for that descriptor?
> When it gets out to actually setup the signal handler, it
> just resumes like it is returning from an SA_RESTART signal
> handler (which according to another posting would reissue
> the IO command and get EBADF).
Stop using signal, it is slow for threaded process, first you don't
know which threads are using the descriptor, second, you have
to run long code path in kernel signal code to find and deliver
the signals to all interested threads, that is too expensive for
benchmark like apache benchmark.
David Xu
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
davidxu

|
Posted: 2006-12-13 7:33:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
> > In message <email***@***.com>, Bruce Evans writes:
> >> On Mon, 11 Dec 2006, Daniel Eischen wrote:
> >>
> >> It's probably a nightmare in the kernel too. close() starts looking
> >> like revoke(), and revoke() has large problems and bugs in this area.
> >
> > There is the distinctive difference that revoke() operates on a name
> > and close() on a filedescriptor, but otherwise I agree.
>
> Well, if threads waiting on IO are interruptable by signals,
> can't we make a new signal that's only used by the kernel
> and send it to all threads waiting on IO for that descriptor?
> When it gets out to actually setup the signal handler, it
> just resumes like it is returning from an SA_RESTART signal
> handler (which according to another posting would reissue
> the IO command and get EBADF).
Stop using signal, it is slow for threaded process, first you don't
know which threads are using the descriptor, second, you have
to run long code path in kernel signal code to find and deliver
the signals to all interested threads, that is too expensive for
benchmark like apache benchmark.
David Xu
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
Arne H. Juul

|
Posted: 2006-12-13 10:00:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Tue, 12 Dec 2006, Greg Lewis wrote:
> This is, unfortunately, a known problem. See
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/97921
Yeah, I got redirected there by somebody else too; it seems I've
managed to spark lots of debate now at least. Copying linux_close.c and
thereby working around the problem in the Java VM looks like it solves
my immediate problem, and could probably be integrated into the diablo
jdk too? I've tried the C version of the test program and it behaves
"badly" on Linux, FreeBSD 6, and NetBSD at least, so patching over it
is probably the best medium-term solution.
- Arne H. J.
|
| |
|
| |
 |
arnej

|
Posted: 2006-12-13 10:03:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Tue, 12 Dec 2006, Greg Lewis wrote:
> This is, unfortunately, a known problem. See
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/97921
Yeah, I got redirected there by somebody else too; it seems I've
managed to spark lots of debate now at least. Copying linux_close.c and
thereby working around the problem in the Java VM looks like it solves
my immediate problem, and could probably be integrated into the diablo
jdk too? I've tried the C version of the test program and it behaves
"badly" on Linux, FreeBSD 6, and NetBSD at least, so patching over it
is probably the best medium-term solution.
- Arne H. J.
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
Bruce Evans

|
Posted: 2006-12-13 11:28:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Wed, 13 Dec 2006, David Xu wrote:
> On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
>> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
>>> In message <email***@***.com>, Bruce Evans writes:
>>>> On Mon, 11 Dec 2006, Daniel Eischen wrote:
>>>>
>>>> It's probably a nightmare in the kernel too. close() starts looking
>>>> like revoke(), and revoke() has large problems and bugs in this area.
>>>
>>> There is the distinctive difference that revoke() operates on a name
>>> and close() on a filedescriptor, but otherwise I agree.
>>
>> Well, if threads waiting on IO are interruptable by signals,
>> can't we make a new signal that's only used by the kernel
>> and send it to all threads waiting on IO for that descriptor?
>> When it gets out to actually setup the signal handler, it
>> just resumes like it is returning from an SA_RESTART signal
>> handler (which according to another posting would reissue
>> the IO command and get EBADF).
>
> Stop using signal, it is slow for threaded process, first you don't
> know which threads are using the descriptor, second, you have
> to run long code path in kernel signal code to find and deliver
> the signals to all interested threads, that is too expensive for
> benchmark like apache benchmark.
A signal would be fast enough for revoke() since revoke() is not used
much, and would work well if the signal could be sent, and is unmaskable,
and all device drivers catch signals (oops, all of them act like
applications whose signal catching function just sets a flag, except
while they sleep, so they have the usual problems with just setting a
flag -- they may run for too long before actually using the setting).
However, I think there is no way to determine which threads are using
an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
Kernel data structures just aren't set up to do this search efficiently,
and shouldn't be bloated to do it.
For close() on non-devices, there is the additional problem of infinite
disk waits due to things like nfs servers down and bugs. Then signals
don't work and you wouldn't like close() by a thread trying to clean
up the problem to hang too. Otherwise close()/revoke() would be a good
way to cancel an infinite disk wait.
Bruce
|
| |
|
| |
 |
bde

|
Posted: 2006-12-13 11:30:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Wed, 13 Dec 2006, David Xu wrote:
> On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
>> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
>>> In message <email***@***.com>, Bruce Evans writes:
>>>> On Mon, 11 Dec 2006, Daniel Eischen wrote:
>>>>
>>>> It's probably a nightmare in the kernel too. close() starts looking
>>>> like revoke(), and revoke() has large problems and bugs in this area.
>>>
>>> There is the distinctive difference that revoke() operates on a name
>>> and close() on a filedescriptor, but otherwise I agree.
>>
>> Well, if threads waiting on IO are interruptable by signals,
>> can't we make a new signal that's only used by the kernel
>> and send it to all threads waiting on IO for that descriptor?
>> When it gets out to actually setup the signal handler, it
>> just resumes like it is returning from an SA_RESTART signal
>> handler (which according to another posting would reissue
>> the IO command and get EBADF).
>
> Stop using signal, it is slow for threaded process, first you don't
> know which threads are using the descriptor, second, you have
> to run long code path in kernel signal code to find and deliver
> the signals to all interested threads, that is too expensive for
> benchmark like apache benchmark.
A signal would be fast enough for revoke() since revoke() is not used
much, and would work well if the signal could be sent, and is unmaskable,
and all device drivers catch signals (oops, all of them act like
applications whose signal catching function just sets a flag, except
while they sleep, so they have the usual problems with just setting a
flag -- they may run for too long before actually using the setting).
However, I think there is no way to determine which threads are using
an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
Kernel data structures just aren't set up to do this search efficiently,
and shouldn't be bloated to do it.
For close() on non-devices, there is the additional problem of infinite
disk waits due to things like nfs servers down and bugs. Then signals
don't work and you wouldn't like close() by a thread trying to clean
up the problem to hang too. Otherwise close()/revoke() would be a good
way to cancel an infinite disk wait.
Bruce
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
kostikbel

|
Posted: 2006-12-13 15:11:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
--5uO961YFyoDlzFnP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Dec 12, 2006 at 08:18:32AM -0500, Daniel Eischen wrote:
> On Mon, 11 Dec 2006, Daniel Eischen wrote:
>=20
> >On Tue, 12 Dec 2006, Arne H. Juul wrote:
> >
> >>On Tue, 12 Dec 2006, David Xu wrote:
> >>>On Tuesday 12 December 2006 06:34, Arne H. Juul wrote:
> >>><snip>
> >>>>This is exactly the sort of issue that should be solved by the
> >>>>thread library / kernel threads implementation and not in every
> >>>>threaded application that needs it, in my view.
> >>>>
> >>>It should not be done in new thread library, do you want a bloat
> >>>and error-prone thread library ? Instead if this semantic is really
> >>>necessary, it should be done in kernel.
> >>
> >>Well, it depends on the alternatives.
> >>If a clean kernel implementation is possible - yes please, of course.
> >>If only a complex, error-prone kernel implementation is possible,
> >>I would prefer to have the complexity in the thread library.
> >
> >Hacking libthr or libpthread to do this for you is not
> >an option. They would then look like libc_r since all
> >fd's accesses would need to be wrapped. If this needs
> >to be done, it must be in the kernel.
>=20
> It's also couldn't be entirely solved by fixing it in the
> threads library. You could still have a non-threaded
> application that waits on a read operation, but receives
> a signal and closes the socket in the signal handler.
This is not the problem. The read (as syscall being executed) is aborted
when signal is delivered. Original poster considered situation where
read() is active (in particular, f_count of struct file is incremented
by fget, that caused the reported behaviour).
--5uO961YFyoDlzFnP
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
iD8DBQFFfrUeC3+MBN1Mb4gRAhCXAKCJxzJsY0KFk3GYwKTqTSC2ZLWybQCgjA8M
Lfnc6O8F144t8wd826jDuX0=
=6wvE
-----END PGP SIGNATURE-----
--5uO961YFyoDlzFnP--
|
| |
|
| |
 |
Julian Elischer

|
Posted: 2006-12-13 15:12:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
Bruce Evans wrote:
> On Wed, 13 Dec 2006, David Xu wrote:
>
>> On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
>>> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
>>>> In message <email***@***.com>, Bruce Evans writes:
>>>>> On Mon, 11 Dec 2006, Daniel Eischen wrote:
>>>>>
>>>>> It's probably a nightmare in the kernel too. close() starts looking
>>>>> like revoke(), and revoke() has large problems and bugs in this area.
>>>>
>>>> There is the distinctive difference that revoke() operates on a name
>>>> and close() on a filedescriptor, but otherwise I agree.
>>>
>>> Well, if threads waiting on IO are interruptable by signals,
>>> can't we make a new signal that's only used by the kernel
>>> and send it to all threads waiting on IO for that descriptor?
>>> When it gets out to actually setup the signal handler, it
>>> just resumes like it is returning from an SA_RESTART signal
>>> handler (which according to another posting would reissue
>>> the IO command and get EBADF).
>>
>> Stop using signal, it is slow for threaded process, first you don't
>> know which threads are using the descriptor, second, you have
>> to run long code path in kernel signal code to find and deliver
>> the signals to all interested threads, that is too expensive for
>> benchmark like apache benchmark.
>
> A signal would be fast enough for revoke() since revoke() is not used
> much, and would work well if the signal could be sent, and is unmaskable,
> and all device drivers catch signals (oops, all of them act like
> applications whose signal catching function just sets a flag, except
> while they sleep, so they have the usual problems with just setting a
> flag -- they may run for too long before actually using the setting).
> However, I think there is no way to determine which threads are using
> an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
> Kernel data structures just aren't set up to do this search efficiently,
> and shouldn't be bloated to do it.
that's processes.. which thread in the process is the one that is
currently waiting on the socket?
>
> For close() on non-devices, there is the additional problem of infinite
> disk waits due to things like nfs servers down and bugs. Then signals
> don't work and you wouldn't like close() by a thread trying to clean
> up the problem to hang too. Otherwise close()/revoke() would be a good
> way to cancel an infinite disk wait.
>
> Bruce
> _______________________________________________
> email***@***.com mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
julian

|
Posted: 2006-12-13 15:14:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
Bruce Evans wrote:
> On Wed, 13 Dec 2006, David Xu wrote:
>
>> On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
>>> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
>>>> In message <email***@***.com>, Bruce Evans writes:
>>>>> On Mon, 11 Dec 2006, Daniel Eischen wrote:
>>>>>
>>>>> It's probably a nightmare in the kernel too. close() starts looking
>>>>> like revoke(), and revoke() has large problems and bugs in this area.
>>>>
>>>> There is the distinctive difference that revoke() operates on a name
>>>> and close() on a filedescriptor, but otherwise I agree.
>>>
>>> Well, if threads waiting on IO are interruptable by signals,
>>> can't we make a new signal that's only used by the kernel
>>> and send it to all threads waiting on IO for that descriptor?
>>> When it gets out to actually setup the signal handler, it
>>> just resumes like it is returning from an SA_RESTART signal
>>> handler (which according to another posting would reissue
>>> the IO command and get EBADF).
>>
>> Stop using signal, it is slow for threaded process, first you don't
>> know which threads are using the descriptor, second, you have
>> to run long code path in kernel signal code to find and deliver
>> the signals to all interested threads, that is too expensive for
>> benchmark like apache benchmark.
>
> A signal would be fast enough for revoke() since revoke() is not used
> much, and would work well if the signal could be sent, and is unmaskable,
> and all device drivers catch signals (oops, all of them act like
> applications whose signal catching function just sets a flag, except
> while they sleep, so they have the usual problems with just setting a
> flag -- they may run for too long before actually using the setting).
> However, I think there is no way to determine which threads are using
> an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
> Kernel data structures just aren't set up to do this search efficiently,
> and shouldn't be bloated to do it.
that's processes.. which thread in the process is the one that is
currently waiting on the socket?
>
> For close() on non-devices, there is the additional problem of infinite
> disk waits due to things like nfs servers down and bugs. Then signals
> don't work and you wouldn't like close() by a thread trying to clean
> up the problem to hang too. Otherwise close()/revoke() would be a good
> way to cancel an infinite disk wait.
>
> Bruce
> _______________________________________________
> email***@***.com mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "email***@***.com"
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
Bruce Evans

|
Posted: 2006-12-13 19:28:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Tue, 12 Dec 2006, Julian Elischer wrote:
> Bruce Evans wrote:
>> A signal would be fast enough for revoke() since revoke() is not used
>> much, and would work well if the signal could be sent, and is unmaskable,
>> and all device drivers catch signals (oops, all of them act like
>> ...
>> However, I think there is no way to determine which threads are using
>> an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
>> Kernel data structures just aren't set up to do this search efficiently,
>> and shouldn't be bloated to do it.
>
> that's processes.. which thread in the process is the one that is currently
> waiting on the socket?
Do you mean that this wouldn't work the signal would need to be per-thread
but signals are per-process? Aren't there per-thread signals now?
It's not just one thread, at least for general files. There can be any
number. I just remembered that SIGIO delivery has problems near here.
There is some i/o on a device, and the kernel has to figure out all
open fd's on the device with O_ASYNC set on the open file of the fd. It
has difficulty doing this, even with some data structures pointing from
the device back to the processes. In theory there can be any number of
fd's with the same open file and the signal should be broadcast to the
processes owning these fd's). This is still simpler than signaling
threads in i/o functions since the signal is broadcast.
I said that something like fstat(1) groping in kmem is needed to find all
the relevant threads. That is nowhere near enough -- fstat cannot tell
which threads are currently in i/o functions. Something closer to what
debuggers do is needed -- stop all threads and stack trace them all to
see where they are :-).
Bruce
|
| |
|
| |
 |
bde

|
Posted: 2006-12-13 19:45:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Tue, 12 Dec 2006, Julian Elischer wrote:
> Bruce Evans wrote:
>> A signal would be fast enough for revoke() since revoke() is not used
>> much, and would work well if the signal could be sent, and is unmaskable,
>> and all device drivers catch signals (oops, all of them act like
>> ...
>> However, I think there is no way to determine which threads are using
>> an fd short of doing the equivalent of fstat(1) searching throuhj kmem.
>> Kernel data structures just aren't set up to do this search efficiently,
>> and shouldn't be bloated to do it.
>
> that's processes.. which thread in the process is the one that is currently
> waiting on the socket?
Do you mean that this wouldn't work the signal would need to be per-thread
but signals are per-process? Aren't there per-thread signals now?
It's not just one thread, at least for general files. There can be any
number. I just remembered that SIGIO delivery has problems near here.
There is some i/o on a device, and the kernel has to figure out all
open fd's on the device with O_ASYNC set on the open file of the fd. It
has difficulty doing this, even with some data structures pointing from
the device back to the processes. In theory there can be any number of
fd's with the same open file and the signal should be broadcast to the
processes owning these fd's). This is still simpler than signaling
threads in i/o functions since the signal is broadcast.
I said that something like fstat(1) groping in kmem is needed to find all
the relevant threads. That is nowhere near enough -- fstat cannot tell
which threads are currently in i/o functions. Something closer to what
debuggers do is needed -- stop all threads and stack trace them all to
see where they are :-).
Bruce
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
David Xu

|
Posted: 2006-12-13 20:11:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
> > In message <email***@***.com>, Bruce Evans writes:
> >> On Mon, 11 Dec 2006, Daniel Eischen wrote:
> >>
> >> It's probably a nightmare in the kernel too. close() starts looking
> >> like revoke(), and revoke() has large problems and bugs in this area.
> >
> > There is the distinctive difference that revoke() operates on a name
> > and close() on a filedescriptor, but otherwise I agree.
>
> Well, if threads waiting on IO are interruptable by signals,
> can't we make a new signal that's only used by the kernel
> and send it to all threads waiting on IO for that descriptor?
> When it gets out to actually setup the signal handler, it
> just resumes like it is returning from an SA_RESTART signal
> handler (which according to another posting would reissue
> the IO command and get EBADF).
Even if you have implemented the close() with the interruption, another
thread openning a file still can reuse the file handle immediately,
according to specifications, the lowest free file handle will be returned,
if SA_RESTART is used, the interrupted thread restart the syscall,
it will be using a wrong file, I think even if we have implemented the
feature in kernel, useland threads still has serious race to fix.
David Xu
|
| |
|
| |
 |
davidxu

|
Posted: 2006-12-13 20:12:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Wednesday 13 December 2006 04:49, Daniel Eischen wrote:
> On Tue, 12 Dec 2006, Poul-Henning Kamp wrote:
> > In message <email***@***.com>, Bruce Evans writes:
> >> On Mon, 11 Dec 2006, Daniel Eischen wrote:
> >>
> >> It's probably a nightmare in the kernel too. close() starts looking
> >> like revoke(), and revoke() has large problems and bugs in this area.
> >
> > There is the distinctive difference that revoke() operates on a name
> > and close() on a filedescriptor, but otherwise I agree.
>
> Well, if threads waiting on IO are interruptable by signals,
> can't we make a new signal that's only used by the kernel
> and send it to all threads waiting on IO for that descriptor?
> When it gets out to actually setup the signal handler, it
> just resumes like it is returning from an SA_RESTART signal
> handler (which according to another posting would reissue
> the IO command and get EBADF).
Even if you have implemented the close() with the interruption, another
thread openning a file still can reuse the file handle immediately,
according to specifications, the lowest free file handle will be returned,
if SA_RESTART is used, the interrupted thread restart the syscall,
it will be using a wrong file, I think even if we have implemented the
feature in kernel, useland threads still has serious race to fix.
David Xu
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
deischen

|
Posted: 2006-12-13 22:28:00 |
Top |
java-programmer >> close() of active socket does not work on FreeBSD 6
On Mon, 11 Dec 2006, Daniel Eischen wrote:
>
> Common sense leads me to think that a close() should release
> threads in IO operations (reads/writes/selects/polls) and
> return EBADF or something appropriate. At least when behavior
> is not dictated by POSIX or other historical/defactor behavior.
BTW, I tested the behavior on Solaris. Solaris returns EBADF
with the posted sample C program.
--
DE
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "email***@***.com"
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- 2
- Bug#305847: ITP: libservlet2.4-java -- Servlet 2.4 and JSP 2.0 Java classes and documentationPackage: wnpp
Severity: wishlist
* Package name : libservlet2.4-java
Version : 2.4
Upstream Author : Apache Jakarta Group
* URL or Web page : http://jakarta.apache.org/tomcat/index.html
* License : Apache 2.0
Description : Servlet 2.4 and JSP 2.0 Java classes and documentation
For more information about Java servlets please take a look at the Tomcat
home page at http://jakarta.apache.org/tomcat/index.html.
.
The official Servlet 2.4 and JSP 2.0 specifications can be found at
http://java.sun.com/products/servlet/ and http://java.sun.com/products/jsp/.
This is a split of tomcat5 source package (this one will be package later)
--
Arnaud Vandyck
Java Trap: http://www.gnu.org/philosophy/java-trap.html
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 3
- Struts: How do I validate data from an edit form?Hello!
In my Struts app - after submit - I want to validate fields that were
filled with values from a database beforehand. To fill the fields with
the old values I write the existing data into a bean and use it in my
JSP as follows:
<jsp:useBean id="formData" scope="request" class="com.xyz"/>
<html:text name="formData" property="test"/>
So far so good.
When a validation error occurs the user is redirected to the same JSP.
The problem now is that the fields are empty because the bean defined
in the JSP doesn't exist anymore. In fact I actually don't want this
bean to be used. The form-bean which is containing the new data should
be used.
How can I acchieve that?
Regards,
Stefan
- 4
- Loop to handle many field condition statementsI have some code that works great in my Bean class that looks like the
below where I have around 15 fields. For example I condensed it to 2
fields:
//bean model part
HashMap errors = new HashMap();
String firstname = "Joe";
String lastname = "Miller";
if (firstname.equals(""))
{
errors.put("firstname","missing firstname".);
}
if (lastname.equals(""))
{
errors.put("lastname","missing lastname");
}
//Each field is then called like this in a View page:
errors.get("firstname"));
errors.get("lastname"));Anyway I can create a loop to go through all
15 fields or how is the best way to do this??
//use Array or Iterator or List or what to get the 15 fields then
loop?
for(int i= 0;i < 15;i++)
{
/*
how would I make this part work?
if (firstname.equals(""))
{
errors.put("firstname","missing firstname".);
}
if (lastname.equals(""))
{
errors.put("lastname","missing lastname");
}
/*
}
Please advise.
- 5
- Using firePropertyChangeIf I have x number of properties, all of which have public getters and
setters methods, is it a good idea to have a
firePropertyChange(fieldName, oldValue, newValue) method inside those
individual setters?
I understand that it only applies to "bound property". What constitute
a "bound"?
- 6
- Which WebSphere productsHi,
I want to develop some portal application with WebSphere. There are
quite a few modules/plugins for WebSphere. I don't know which ones are
useful. I downloaded the following WebSphere related products:
- WebSphere Application Community Edition Version 2 (for Solaris 10)
- Eclipse SDK (3.3.1.1) for Windows
- RAD_V7.0_Part(1-10)
I don't know how useful is RAD_V7.0.
I also found IBM website also have a product called "WebSphere Portal
V6.0". I am confused which products I need to download? The
requirement of my development is shown as below:
Mandatory:
- Develop Portal and Portlets.
- Interact with MySQL database engine (3.0)
Optionally:
- UML (able to reverse engineering).
Can anyone please tell me what modules I need to download? and where
can I download it?
I may be need to give a call to IBM to get a trail version of CDs that
include these application. But I want to know how I need in this
development.
Thank you very much in advance.
- 7
- customize JScrollBarHello,
I want to scroll up/down by pressing buttons
other than the standards of JScrollBar(These
simple up und down arrows).
Is it possible?
- 8
- JTextArea.setLineWrap(true); not working properly with JSplitPane ??Hi,
I have a very strange behavior ...
Placing a JTextArea which is set to: setLineWrap(true); in a JPanel and
the JPanel in a JSplitPane causes the JSplitPane to get stuck (it can't
be moved ...).
It happens with all the layouts that I've tried: BorderLayout,
BoxLayout, with the GridBagLayout it happens when setting the
GridBagConstraints.fill to GridBagConstraints.HORIZONTAL or
GridBagConstraints.BOTH (it doesn't happen when setting it to
GridBagConstraints.NONE or GridBagConstraints.VERTICAL).
However, placing the JTextArea in a JScrollPane works fine (but it's
not a good solution for me).
Does anyone have any idea why it happens and how it can be solved?
Thanks.
- 9
- IllegalStateException...Writer being already used by this servletHi All,
I am faceing a problem (ofcourse thats what makes all of us come
here)..what I am trying to do is , create a image offscreen in a
servlet , then using PixelGrabber serialize the int[] and then the
applet reads it, ..so far fairly straight, now here...
...
...
ObjectOutputStream out = new
ObjectOutputStream(res.getOutputStream());
System.out.println("Inside isReq after out obj");
out.writeInt(w);
out.writeInt(h);
out.writeObject(pixels);
}
/**
try{
res.setContentType("text/html");
printer=res.getWriter();
printer.println("Object Writing done");
printer.close();
}catch(Exception ex){}
}
else{
printer.println("Object Writing <b>Not</b> done");
printer.close();
}**/
After Object writing is being done , I wish to display a html page
(with applet embedded) but using the above code it is giving me a
error "IllegalStateException: Writer being already used by the
servlet..."
Can anyone help me out...
Regards
Ray
- 10
- java dont have #includes, it sucks !!!http://java.sun.com/docs/books/tutorial/java/concepts/class.html
how can i link diferent modules in one single .class in that lousy
object-wacko language ??? java sucks !!!!!
hahahahahahahahahahahahahahahahaha
either have pointers or #defines !!!! its a C abortion !!!! who
cares ???
C RUUUUUUUULEEEEEZZZZZZZZZ DAMMIT !!!!
- 11
- Potentially dumb questionCould anyone tell me where I might download the latest version of the
Java Development Kit? I have an old Java book and I thought I might
play with it but I need a kit that works with Win XP.
TIA
-Lex
- 12
- toString() or Renderer(s) for BizObjects shown in GUI ComponentsHi There,
What do people prefer for populating GUI Components (Swing) with
Business Objects ?
overriding the toString() method of those Business Objects ? or
creating renderers for each type of component ? (or something else ?)
overriding the toString() method seems easiest, and seems to work --
even seems like thats how the Swing designers intended it (since
components like JComboBox, JList, etc take Objects to populate the
model),
but of course - it may be that in one instance you want your Person
BusinessObject to show up as LastName, FirstName, and in another
component you want to see FirstName, LastName - so a single toString()
method won't cut it.
using renderers instead of toString seems to work too -- but means
potentially writing renderers for almost every component and business
object combination (assuming no use of the toString() method on the
business objects).
Does anybody have any thoughts on this ? a better approach ?
Many Thanks
T
- 13
- doubts regarding j2meI am new in j2me...I have some doubts...
1. How to insert an image into a servlet?
2. How to access it from a mobile using j2me?
3. How to send an image file from a mobile to a servlet?
Please help me...
- 14
- WHICH J2ME Development Tool?Hello,
After researching the J2ME development tools, I finally decided on NetBeans
and I downloaded it today, with the mobility pack. I found NetBeans be very
powerful, yet I am just starting with Java. NetBeans overwhelmed me, even
with the simple NetBeans-generated "Hello World" MIDLet. I need a simpler
and less powerful development tool. Which development tool do you use for
J2ME? Thank you very much.
Best Regards,
T.I.
- 15
- Bug#297574: upstream test case
Similar problem (jar to native compilation) reported in
http://gcc.gnu.org/PR18931
(closed)
the _exact_ bug is reported in
http://gcc.gnu.org/PR19505
(open)
test case PR19505.class still fails with gcj-snapshot (20050227)
GNU Java version 4.1.0 20050227 (experimental) (i486-linux-gnu)
compiled by GNU C version 4.1.0 20050227 (experimental).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32066
...
Note comment #2 on http://gcc.gnu.org/PR19505 : gcj fails to compile
bytecode produced by Sun's javac, but not when compiling bytecode
produced by gcj (with -C) or ecj.
comment #2 is posted in 2005-01-25 (same as the failing gcj I am
using), but I am compiling a .jar produced by gcj (I guess bug was
introduced some time between 2004-12-28 and 2005-01-25)
I am testing again:
gcj-snapshot -O2 -Wl,-Bsymbolic -shared -fPIC -fjni -findirect-dispatch -o /tmp/jdt.jar.so /usr/share/eclipse/plugins/org.eclipse.jdt.ui_3.0.1/jdt.jar
now. It take long time, but problem with gcj 4.0 20050125 happen soon,
I still do not see problem, by now. The jar is compiled with gcj 4.0
20050125
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
|
|
|