Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

wip #528

Closed
wants to merge 1 commit into from
Closed

wip #528

wants to merge 1 commit into from

Conversation

indutny
Copy link
Contributor

@indutny indutny commented Aug 16, 2012

wip

@travisbot
Copy link

This pull request passes (merged b6f1b132 into 938a305).

@travisbot
Copy link

This pull request passes (merged fa5fd5c1 into 938a305).

@travisbot
Copy link

This pull request passes (merged 38caf8e3 into 938a305).

int accepted_fd; \
int fd; \

#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grep for UV_LOOP_PRIVATE_PLATFORM_FIELDS and use that approach instead. Duplicating the fields is bound to break later on.

@bnoordhuis
Copy link
Contributor

Lots of remarks but the concept seems sound enough to me. :-)

@travisbot
Copy link

This pull request passes (merged 610f5756 into 938a305).

@travisbot
Copy link

This pull request passes (merged a8ce8989 into 938a305).

@@ -175,6 +175,24 @@ struct uv__io_s {
uv_handle_t* next_closing; \


#if defined(__APPLE__)

# define UV_STREAM_PRIVATE_PLATFORM_FIELDS \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this waste a big chunk of memory per stream on os x?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, I can allocate it on-demand

@travisbot
Copy link

This pull request passes (merged c3c42684 into 938a305).

@travisbot
Copy link

This pull request passes (merged ea5216aa into 938a305).

@travisbot
Copy link

This pull request passes (merged f1f5f14c into 938a305).

uv_thread_t thread;
uv_sem_t sem;
uv_mutex_t mutex;
struct uv_async_s* async;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not embed this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unknown at the moment of declaration of this structure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to shuffle a little bit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedor, you can turn the field in UV_STREAM_PRIVATE_PLATFORM_FIELDS into a void* and move the declaration of uv__stream_select_s into src/unix/stream.c.

@travisbot
Copy link

This pull request passes (merged cecad24c into 1b929bf).

@indutny
Copy link
Contributor Author

indutny commented Aug 17, 2012

Everything resolved.

@travisbot
Copy link

This pull request passes (merged e8035e9f into 1b929bf).

@travisbot
Copy link

This pull request passes (merged e91d31b5 into 1b929bf).

uv_thread_t thread;
uv_sem_t sem;
uv_mutex_t mutex;
uv_async_t* async;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you embed the uv_async_t?

@indutny
Copy link
Contributor Author

indutny commented Aug 17, 2012

Fixed everything.

@travisbot
Copy link

This pull request passes (merged 1b1b1da9 into e22af9ba).

@travisbot
Copy link

This pull request passes (merged ea71e33c into 3b69c0f).

}


int uv__stream_needs_select(uv_stream_t* stream, int fd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convention: return -1 on error, 0 on success.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I need to rename it then.

kqueue(2) on osx doesn't work (emits EINVAL error) with specific fds
(i.e. /dev/tty, /dev/null, etc). When given such descriptors - start
select(2) watcher thread that will emit io events.
@indutny
Copy link
Contributor Author

indutny commented Aug 20, 2012

Does it looks better now?

@indutny
Copy link
Contributor Author

indutny commented Aug 20, 2012

Oh, pushed into another repo :) Should be good now.

@travisbot
Copy link

This pull request passes (merged 887cda3 into 28ff142).

@bnoordhuis
Copy link
Contributor

Thanks Fedor, landed in 5da380a.

@bnoordhuis bnoordhuis closed this Aug 20, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants